473,322 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

data change event

52
Hi

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 14037
ADezii
8,834 Expert 8TB
@Chinde
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
Chinde
52
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
FishVal
2,653 Expert 2GB
Hi, Chinde.

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

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

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

Similar topics

0
by: Fabian Kr?ger | last post by:
Hello, I got a weird problem and need your help and ideas... I´ve written an php application which imports data in XML format and writes this data to a MySQL database to have a faster access....
7
by: mittal.pradeep | last post by:
What is the better table design for a data collection application. 1. Vertical model (pk, attributeName, AttributeValue) 2. Custom columns (pk, custom1, custom2, custom3...custom50) Since the...
10
by: Georges Heinesch | last post by:
Hi. BeforeUpdate code: Me!cboFoo.Text = UCase(Me!cboFoo.Text) I get the error: Run-time error '2115': The macro or function set to the BeforeUpdate or ValidationRule
3
by: Christopher Koh | last post by:
how do you stop Access from saving any changed data in your tables and queries? like i just add or change data on the table/query tables,then click on X (exit)because i have no intention of saving...
19
by: Simon Verona | last post by:
I'm not sure if I'm going down the correct route... I have a class which exposes a number of properties of an object (in this case the object represents a customer). Can I then use this...
4
by: Nalaka | last post by:
Hi, I have two questions about gridViews. 1. How can I intercept the row/column values at loading to change values? 2. After I update a row (using default update functionality), how can I...
14
by: Steve Teeples | last post by:
I don't understand why I cannot use a property to modify data within a struct. Can someone tell me why I get the error "Cannot modify the return value of "myData.TheData" because it is not a...
30
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.