By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,786 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,786 IT Pros & Developers. It's quick & easy.

Disable Me.Dirty Access 2002

P: n/a
Okay all you GURUS out there... here's the skinny... I need a way to
prevent the Me.Dirty event to trigger after a FORM_OPEN event. What I
have is a field that is dependent on another field that determines it's
value. In short, here's is the code (in a simple presentation) that
will trigger the Dirty event (comments added to preserve formating):

'Private Sub Form_Open(Cancel As Integer)
'~~~~~~~~
'Good code Here
'~~~~~~~~
'
' If DDyear <> "" Then
' If DDyear = Format(Date, "yyyy") Then
' d1 = 4
' dde.Caption = "4"
' ddr.Caption = "4"
' Else
' d1 = 2
' dde.Caption = "2"
' ddr.Caption = "2"
' End If
' Else
' d1 = 0
' dde.Caption = "4"
' ddr.Caption = "4"
' End If
' DoCmd.Save
' Me.Dirty = False
'
'Exit_Form_Open:
' Exit Sub
'
'Err_Form_Open:
' MsgBox "YOU DO NOT HAVE PERMISSION TO USE THIS DATABASE AT THIS
TIME"
' DoCmd.Quit
' Resume Exit_Form_Open
'End Sub
'
'Private Sub Form_BeforeUpdate(Cancel As Integer)
' If Me.Dirty Then
' Me.DateUpdated = Format(Now(), "dd-mmm-yy")
' End If
'End Sub

Because I set the value of d1, this will trigger the dirty event. I
have tried to SAVE the record to reset Me.Dirty and I tried to set it
to FALSE. Is there another way?

I think I may need to create more conditional statements so that if
d1=2 and I meet the requirements of the ELSE, then I don't need to
reset d1 to 2. Hey, I may have already solved this...

But, in essence, can you temporarily disable the DIRTY event? Thanks in
advance for addressing this...

Rusty I. Peace

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You might be able to stop the Dirty event from firing by temporaritly
setting the ControlSouce property of the control to an empty sting and then
back.

Darryl Kerkeslager
<RI****@hotmail.com> wrote
Okay all you GURUS out there... here's the skinny... I need a way to
prevent the Me.Dirty event to trigger after a FORM_OPEN event. What I
have is a field that is dependent on another field that determines it's
value. In short, here's is the code (in a simple presentation) that
will trigger the Dirty event (comments added to preserve formating): [snip]
But, in essence, can you temporarily disable the DIRTY event? Thanks in
advance for addressing this...

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.