Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 19th, 2006, 08:15 PM
lindseyhansen
Guest
 
Posts: n/a
Default form_dirty event triggered from code

Access 2000 with linked tables to SQL Server 2000:

I have a form where I am trying to update a date field when any of the
fields for the current saved record get changed. I am using the
form_dirty event to set this date. I have one database (mdb) where
this works fine. I tried to duplicate the same behavior in a second
mdb, and it causes the form_dirty event to fire at least a hundred
times before it finally 'completes'. This is a problem because I have
other code that fires in the form_dirty event as well, and this slows
the performance of my form considerably.

I thought that maybe I had a problem with my database, so I created a
new database to isolate the functionality. I have the same problem
(repeated firing of the form_dirty event).

When I run the database in Access 2003, it works 'fine'; the form_dirty
event only fires once.

I've re-installed MDAC 2.8 SP1, I've re-installed Office 2000.

The stripped-down code is as simple as:

Private Sub Form_Dirty(Cancel As Integer)
Me.ReceivedDt = Now()
End Sub

Nothing seems to help. Any suggestions would be greatly appreciated!

  #2  
Old December 19th, 2006, 09:15 PM
John Welch
Guest
 
Posts: n/a
Default Re: form_dirty event triggered from code

I had other problems when I used to use the form_dirty event to update a
"date record changed" field.(they had to do with multiple users and record
locking.)
I switched to putting the code in the form_beforeUpdate event instead, and
now it works fine for me. I think that is the generally 'preferred' way of
doing this. (The only drawback is that you don't see the "date edited" field
change as soon as you type something on the form - it only happens just
before the record is saved.)
-John

"lindseyhansen" <lindsey.hansen@fmc-na.comwrote in message
news:1166559112.021375.312800@n67g2000cwd.googlegr oups.com...
Quote:
Access 2000 with linked tables to SQL Server 2000:
>
I have a form where I am trying to update a date field when any of the
fields for the current saved record get changed. I am using the
form_dirty event to set this date. I have one database (mdb) where
this works fine. I tried to duplicate the same behavior in a second
mdb, and it causes the form_dirty event to fire at least a hundred
times before it finally 'completes'. This is a problem because I have
other code that fires in the form_dirty event as well, and this slows
the performance of my form considerably.
>
I thought that maybe I had a problem with my database, so I created a
new database to isolate the functionality. I have the same problem
(repeated firing of the form_dirty event).
>
When I run the database in Access 2003, it works 'fine'; the form_dirty
event only fires once.
>
I've re-installed MDAC 2.8 SP1, I've re-installed Office 2000.
>
The stripped-down code is as simple as:
>
Private Sub Form_Dirty(Cancel As Integer)
Me.ReceivedDt = Now()
End Sub
>
Nothing seems to help. Any suggestions would be greatly appreciated!
>

  #3  
Old December 19th, 2006, 09:45 PM
lindseyhansen
Guest
 
Posts: n/a
Default Re: form_dirty event triggered from code

I appreciate the reply.. it's the *other* code in my event, though,
which requires the form_dirty event to fire. For example, I want a
button on my form to become enabled as soon as the record becomes dirty.

 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles