473,397 Members | 1,969 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,397 software developers and data experts.

How do I make a form in access dirty when a filed is changed programatically?

The Dirty function in access is not working for a field that is "programatically" updated. Is there any solution for that?
Jul 30 '10 #1

✓ answered by Stewart Ross

The dirty property cannot be set true by programmatic intervention - unlike setting it false (which saves the current record).

When you set the field value concerned programmatically you can set up a value you can test by making use of the rather overlooked Tag property of the control bound to that field, or the tag property of the form itself, to specify that the field has been updated. Using the control's tag property as an example:

Expand|Select|Wrap|Line Numbers
  1. Me!YourField = <whatever you do to update the field programmatically>
  2. Me!YourField.Tag = "Updated"
Then, where you normally test for Me.Dirty you can add a test for this tag value too:

Expand|Select|Wrap|Line Numbers
  1. If Me.Dirty or Me!YourField.Tag = "Updated" then
  2.    Me.Dirty = False
  3.    Me!YourField.Tag = ""
  4. End If
-Stewart

3 2158
Stewart Ross
2,545 Expert Mod 2GB
The dirty property cannot be set true by programmatic intervention - unlike setting it false (which saves the current record).

When you set the field value concerned programmatically you can set up a value you can test by making use of the rather overlooked Tag property of the control bound to that field, or the tag property of the form itself, to specify that the field has been updated. Using the control's tag property as an example:

Expand|Select|Wrap|Line Numbers
  1. Me!YourField = <whatever you do to update the field programmatically>
  2. Me!YourField.Tag = "Updated"
Then, where you normally test for Me.Dirty you can add a test for this tag value too:

Expand|Select|Wrap|Line Numbers
  1. If Me.Dirty or Me!YourField.Tag = "Updated" then
  2.    Me.Dirty = False
  3.    Me!YourField.Tag = ""
  4. End If
-Stewart
Jul 30 '10 #2
This solution works really well. Thanks Stewart.
Aug 3 '10 #3
Stewart thanks for this solution it really works.
Aug 4 '10 #4

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

Similar topics

4
by: hinrich | last post by:
Hello, I have a completely new system (windows xp prof.), office xp 2002 with sp 3. When I create a new and empty Accesss database, create an empty table and then create a new form using a...
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...
2
by: Chris Hankey | last post by:
I having a strange and annoying problem where Access crashes when the user copies (to the clipboard) the results of a query. The message is not very helpful. It simply says - "Microsoft Access...
2
by: Lenin Torres | last post by:
Hi everybody I have an Union Query that works fine. I used this query as the RecordSource for a Form. That Form is used as a subform in another form. Everything works fine, except for the "Filter...
3
by: Daniel | last post by:
how do i access methods when the .net assembly was loaded with late biding? class Class1 { public static void Main() { System.Reflection.Assembly SampleAssembly; SampleAssembly =...
1
by: Yatharth | last post by:
Its a Web application. I am developing an application in which my page is refreshing continuosly.In that there is a textbox which is filled from the database ,and changed when i changed the ...
1
by: Jon Pope | last post by:
I'm maintaining an internal tool within my organization. Some of my users have resized their system font size by changing the DPI setting from 96DPI to 120DPI (by right-clicking the desktop and...
1
by: lesperancer | last post by:
I've got a form that is opened in readonly mode and no fields can be changed, great but if I click on a combo box that has an _enter() event that sets a field on my form to a value (albeit the...
2
by: Tom_F | last post by:
To comp.databases.ms-access -- I would like to trigger an event when I close a form -- but ONLY when the data in the "RecordSource" table has been updated. I tried using the AfterUpdate event,...
5
by: Michael Kintner | last post by:
Hello Folks, Is there anyway that if no activity has happend (sitting idle) for a period of time that Access would could automatically close or invoke an event? Thank you in advance, Michael...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.