From: Reggie on
Hi and TIA. I have a form in Single form view. Once the user changes a
value the OnDirty event fires as expected, They click my save button to save
the record it is saved. Now they see that they want to change something else
on the same form/same record. When they do this the OnDirty event does not
fire. Any suggestions are appreciated. Thanks!

--

Reggie

From: Jeanette Cunningham on
If you change the process slightly to this:
The Save button has code like this:

If Me.Dirty = True Then
Me.Dirty = False
End If
DoCmd.Close acForm, Me.Name

You wouldn't have any worries with the OnDirty event.

When user saves the record, the form closes.
If they want to go back and change something,
they just choose the record to edit and the whole process runs through
again.

The above process makes it easy for the developer.
If the form is not dirty, nothing is saved.
If user has made changes, they can press Esc once to clear a textbox or
combo, twice to clear all the changes to the record.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"Reggie" <No_Spam_chief123101(a)yahoo.com> wrote in message
news:uEJBSiVxKHA.3408(a)TK2MSFTNGP06.phx.gbl...
> Hi and TIA. I have a form in Single form view. Once the user changes a
> value the OnDirty event fires as expected, They click my save button to
> save the record it is saved. Now they see that they want to change
> something else on the same form/same record. When they do this the
> OnDirty event does not fire. Any suggestions are appreciated. Thanks!
>
> --
>
> Reggie


From: Mr. B on
Reggie,

I had to assume that you are talking about the "dirty" property of your
form. You did not say just what code you have on your save button that is
saving the record. If the record is truly saved and no longer dirty, then
any change to anything on the form should cause the On Dirty event to fire.

Also, what version of Access are you using?

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


"Reggie" wrote:

> Hi and TIA. I have a form in Single form view. Once the user changes a
> value the OnDirty event fires as expected, They click my save button to save
> the record it is saved. Now they see that they want to change something else
> on the same form/same record. When they do this the OnDirty event does not
> fire. Any suggestions are appreciated. Thanks!
>
> --
>
> Reggie
>
> .
>
From: Reggie on
Thanks Jeanette. I knew I could do this but was wanting to leave the focus
in the form on that record (my customers request). My problem is that I
hide/disable controls on the form when the record is dirty. It works fine
the first time it becomes dirty, but after they save it and if they start
editing the record again the ondirty event does not fire and therefore I
can't capture that event to disable/hide my controls. Thanks!

--

Reggie
"Jeanette Cunningham" <nnn(a)discussions.microsoft.com> wrote in message
news:eQ5h$IWxKHA.948(a)TK2MSFTNGP05.phx.gbl...
> If you change the process slightly to this:
> The Save button has code like this:
>
> If Me.Dirty = True Then
> Me.Dirty = False
> End If
> DoCmd.Close acForm, Me.Name
>
> You wouldn't have any worries with the OnDirty event.
>
> When user saves the record, the form closes.
> If they want to go back and change something,
> they just choose the record to edit and the whole process runs through
> again.
>
> The above process makes it easy for the developer.
> If the form is not dirty, nothing is saved.
> If user has made changes, they can press Esc once to clear a textbox or
> combo, twice to clear all the changes to the record.
>
>
> Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
>
>
>
> "Reggie" <No_Spam_chief123101(a)yahoo.com> wrote in message
> news:uEJBSiVxKHA.3408(a)TK2MSFTNGP06.phx.gbl...
>> Hi and TIA. I have a form in Single form view. Once the user changes a
>> value the OnDirty event fires as expected, They click my save button to
>> save the record it is saved. Now they see that they want to change
>> something else on the same form/same record. When they do this the
>> OnDirty event does not fire. Any suggestions are appreciated. Thanks!
>>
>> --
>>
>> Reggie
>
>

From: Reggie on
Mr. B, you are correct in your assumption. I stand corrected. It is
working now. I think when I put it in break mod or something like that was
causing it not to fire. At any rate it is doing as I expected it to do.
Thanks for your (wasted) time.

--

Reggie
"Mr. B" <draccess(a)askdoctoraccess.com.nospamallowed> wrote in message
news:3BED83FA-68E4-491B-8246-81438950DC97(a)microsoft.com...
> Reggie,
>
> I had to assume that you are talking about the "dirty" property of your
> form. You did not say just what code you have on your save button that is
> saving the record. If the record is truly saved and no longer dirty, then
> any change to anything on the form should cause the On Dirty event to
> fire.
>
> Also, what version of Access are you using?
>
> -----
> HTH
> Mr. B
> http://www.askdoctoraccess.com/
> Doctor Access Downloads Page:
> http://www.askdoctoraccess.com/DownloadPage.htm
>
>
> "Reggie" wrote:
>
>> Hi and TIA. I have a form in Single form view. Once the user changes a
>> value the OnDirty event fires as expected, They click my save button to
>> save
>> the record it is saved. Now they see that they want to change something
>> else
>> on the same form/same record. When they do this the OnDirty event does
>> not
>> fire. Any suggestions are appreciated. Thanks!
>>
>> --
>>
>> Reggie
>>
>> .
>>