469,127 Members | 1,390 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,127 developers. It's quick & easy.

data change event


I'm using buttons on a form to pass a given record to the current form, the data passes just fine to the form. When the data in the form changes I would like to run a check to see if a particular control = x then based on the result run a set of commands.

The check and the commands run fine (I use the same ones for an on_load event). but I have no idea how to run the check when the data changes in the form.

any direction much appreciated.

running access2007 on a 2003 DB with OS Xp.
Mar 2 '09 #1
4 13622
8,800 Expert 8TB
You can use the Dirty property to determine whether the Current Record has been modified since it was last saved. The following code will check and see if the Form has been 'Dirtied'. If it is Dirty, the code will then check and see if the Value 99999 exists in the [txtTest] Field. If the Value in this Field is 99999, then a specific set of Command are Run, if not, then the Original Value of the Field is restored. Does this Help you?
Expand|Select|Wrap|Line Numbers
  1. If Me.Dirty Then
  2.   If Me![txtTest] = 99999 Then
  3.     'Run a set of Commands
  4.   Else      'Restore Old Value
  5.     Me![txtTest] = Me![txtTest].OldValue
  6.   End If
  7. End If
Mar 2 '09 #2
This is useful but it is not quite what I want. I've just re-read my original post and have notice the obvious mistake, I want the check to fire when the record in the form changes I.e. when the record in the form moves from record 1 to record 2 or whatever.
Mar 3 '09 #3
2,653 Expert 2GB
Hi, Chinde.

It is "Current" event which fires whenever form is pointed to a record.

Mar 3 '09 #4
I would never have found that without your help. Thank you all is good and working in the world.
Mar 3 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Fabian Kr?ger | last post: by
10 posts views Thread by Georges Heinesch | last post: by
19 posts views Thread by Simon Verona | last post: by
4 posts views Thread by Nalaka | last post: by
14 posts views Thread by Steve Teeples | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.