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

OnDirty only working once

P: n/a
JC
I have a form based on a query. I have the OnDirty event launch a
procedure that enables my custom "Save" button. I press Save after
making my changes and the record is saved. At the end of the Save
procedure I disable the "Save" button. If I then want to change
something else on that same record, the OnDirty event never fires.
If I move to the next record and then back to the present record,
making a change DOES fire the OnDirty event.

Does anyone know why the OnDirty event does not fire the second time
unless I change records?
I have tried to Requery and even programmatically move to another
record and then back to the present record, but I still cannot get it
to work.

Thanks in advance.
- jc -

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


P: n/a
What method are you using in the Save button's click event to save the
record? Have you tried

Me.Dirty = False

I tested this and Dirty fires again when I go to change the record I just
saved.

--
Wayne Morgan
MS Access MVP
"JC" <jc********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I have a form based on a query. I have the OnDirty event launch a
procedure that enables my custom "Save" button. I press Save after
making my changes and the record is saved. At the end of the Save
procedure I disable the "Save" button. If I then want to change
something else on that same record, the OnDirty event never fires.
If I move to the next record and then back to the present record,
making a change DOES fire the OnDirty event.

Does anyone know why the OnDirty event does not fire the second time
unless I change records?
I have tried to Requery and even programmatically move to another
record and then back to the present record, but I still cannot get it
to work.

Thanks in advance.
- jc -

Nov 13 '05 #2

P: n/a
On 29 Jul 2005 10:36:57 -0700, "JC" <jc********@gmail.com> wrote:

<soapbox>
Sigh, how some people want to mangle the standard Access interface.
</soapbox>

Saving a record can be done several ways. Perhaps you could try it
this way:
Me.Dirty = False

After that, the Dirty event will fire again when you edit the same
record.

-Tom.
I have a form based on a query. I have the OnDirty event launch a
procedure that enables my custom "Save" button. I press Save after
making my changes and the record is saved. At the end of the Save
procedure I disable the "Save" button. If I then want to change
something else on that same record, the OnDirty event never fires.
If I move to the next record and then back to the present record,
making a change DOES fire the OnDirty event.

Does anyone know why the OnDirty event does not fire the second time
unless I change records?
I have tried to Requery and even programmatically move to another
record and then back to the present record, but I still cannot get it
to work.

Thanks in advance.
- jc -


Nov 13 '05 #3

P: n/a
JC
Thank you Wayne and Tom...I have been away from the computer and did
not get a chance to read the board for a while. I will try that this
afternoon.
- jc -

Nov 13 '05 #4

P: n/a
JC
Tom, Wayne,
That did just what I wanted - thank you.
- jc -

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.