PC Review


Reply
Thread Tools Rate Thread

On Dirty Event

 
 
Reggie
Guest
Posts: n/a
 
      16th Mar 2010
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

 
Reply With Quote
 
 
 
 
Jeanette Cunningham
Guest
Posts: n/a
 
      16th Mar 2010
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
Mr. B
Guest
Posts: n/a
 
      17th Mar 2010
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
>
> .
>

 
Reply With Quote
 
Reggie
Guest
Posts: n/a
 
      17th Mar 2010
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" <(E-Mail Removed)> wrote in message
news:eQ5h$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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

>
>


 
Reply With Quote
 
Reggie
Guest
Posts: n/a
 
      17th Mar 2010
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" <(E-Mail Removed)> wrote in message
news:3BED83FA-68E4-491B-8246-(E-Mail Removed)...
> 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
>>
>> .
>>


 
Reply With Quote
 
Mr. B
Guest
Posts: n/a
 
      17th Mar 2010
Reggie,

Time was not wasted. We all learn all the time. That is what the forums is
all about.

Good luck with your poject.

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


"Reggie" wrote:

> 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" <(E-Mail Removed)> wrote in message
> news:3BED83FA-68E4-491B-8246-(E-Mail Removed)...
> > 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
> >>
> >> .
> >>

>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Dirty Event Dirk Goldgar Microsoft Access Forms 1 21st Mar 2008 06:24 PM
Dirty Event box2003 Microsoft Access Form Coding 2 26th Feb 2007 02:21 PM
Dirty Event =?Utf-8?B?UGF1bA==?= Microsoft Access Form Coding 1 9th Oct 2006 05:40 PM
Is there a Dirty event Graeme Richardson Microsoft ADO .NET 3 24th Jul 2003 10:25 AM
Dirty Event Daniel Microsoft Access VBA Modules 0 28th Jun 2003 08:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:28 PM.