Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / November 2006

Tip: Looking for answers? Try searching our database.

Dirty event does not fire

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Richard Wright - 24 Jan 2005 17:09 GMT
Access 2003: I want to use the Form_Dirty event, but find it is not firing.  
I have checked all the help pages and searched all over the net.
The form IS a bound form.
Any suggestions?
Dirk Goldgar - 24 Jan 2005 17:48 GMT
> Access 2003: I want to use the Form_Dirty event, but find it is not
> firing. I have checked all the help pages and searched all over the
> net.
> The form IS a bound form.
> Any suggestions?

First questions:

1. What are you doing to make it fire?

2. How do you know it's not firing?

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Richard Wright - 24 Jan 2005 18:29 GMT
I expect it to fire when typing into controls, selecting from combos and
changing to another tab on my multi tab form.

I know its not firing because the properties of a couple of buttons are not
changeing as expected. These are set in the standard sub: Private Sub
Form_Dirty(Cancel As Integer).

(the OnDirty property of the form is correctly set to [Event Procedure] so
I'm flumuxed!)

regards
Richard

> > Access 2003: I want to use the Form_Dirty event, but find it is not
> > firing. I have checked all the help pages and searched all over the
[quoted text clipped - 7 lines]
>
> 2. How do you know it's not firing?
Dirk Goldgar - 24 Jan 2005 18:49 GMT
> I expect it to fire when typing into controls, selecting from combos
> and changing to another tab on my multi tab form.
[quoted text clipped - 5 lines]
> (the OnDirty property of the form is correctly set to [Event
> Procedure] so I'm flumuxed!)

I wouldn't expect the Dirty event to fire just because you change from
one tab page to another.  It should fire when you type into controls or
select from combo boxes, though, provided that those controls are bound.

Set a breakpoint on the Form_Dirty event procedure, then go to form view
and do something that should dirty the form.  If code stops at the
breakpoint, you'll know that the event is being raised.  Then you can
step through the code and see if the code's execution path differs from
what you'd expect.  That would be something else to debug.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Richard Wright - 26 Jan 2005 12:23 GMT
Thanks for your help Dirk.
The Form_Dirty event wasn't firing because I had code in the Form_Activate
event that set the value of one the text boxes on the form.  I have moved
this code to another event and now it's fine - nice and dirty!

thanks again
regards
Richard

> > I expect it to fire when typing into controls, selecting from combos
> > and changing to another tab on my multi tab form.
[quoted text clipped - 15 lines]
> step through the code and see if the code's execution path differs from
> what you'd expect.  That would be something else to debug.
Dirk Goldgar - 27 Jan 2005 05:21 GMT
> Thanks for your help Dirk.
> The Form_Dirty event wasn't firing because I had code in the
> Form_Activate event that set the value of one the text boxes on the
> form.  I have moved this code to another event and now it's fine -
> nice and dirty!

Oh, yeah.  Now that you mention it, I remember that he form's Dirty
event doesn't fire if you have already dirtied it programmatically.  It
only fires, as I now recall, if the form becomes dirty as a result of
user action.  If the form has already been dirtied by code, that can't
happen.

Sorry, I was late remembering that.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Paul - 09 Oct 2006 08:28 GMT
I'd be interested to find out what event you moved your code to that would
cause the on dirty event to fire and what version of access you are using.

i have done extensive testing side by side today with access 2000 and access
2003 and have been unable to get an access 2003 forms on dirty event to fire
with vba code (the form is not dirty before the code modifies the data but is
after the data is modified, yet the event does not fire).

It does fire with access 2000 however.
   

> > Thanks for your help Dirk.
> > The Form_Dirty event wasn't firing because I had code in the
[quoted text clipped - 9 lines]
>
> Sorry, I was late remembering that.
Marshall Barton - 09 Oct 2006 17:47 GMT
Sheesh, how many threads did you start with this question?
It is near impossible to keep track of a train of thought
when it fragmented across multople groups and threads.

I just remembered that there is a way to trigger the usual
events.  If you set a text or combo box's Text property
instead of its Value property, the events are triggered the
same as for user input.
Signature

Marsh
MVP [MS Access]

>I'd be interested to find out what event you moved your code to that would
>cause the on dirty event to fire and what version of access you are using.
[quoted text clipped - 20 lines]
>>
>> Sorry, I was late remembering that.
flores - 03 Nov 2006 20:13 GMT
I just resolved a similar problem.  The big key is that the dirty even fires
only when a CONTROL on the form changes data from a table (by user typing,
pasting, or delteteing).  This means that any unbound control will not triger
the even.  Check to make sure that the control is bound to a table's data
field.

> Access 2003: I want to use the Form_Dirty event, but find it is not firing.  
> I have checked all the help pages and searched all over the net.
> The form IS a bound form.
> Any suggestions?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.