Results 1 to 2 of 2
  1. #1
    ncsthbell is offline Novice
    Windows 2K Access 2007
    Join Date
    Apr 2011
    Location
    NC
    Posts
    1

    Unhappy When do record changes get saved, form has 'bound' columns & recordsource a query?

    I have a form that has the recordsource set to a query and all the 'text' boxes on the form are 'bound'.
    I want to detect when any text box on the form has had data changed. I tried using the 'FormDirty' event. In testing, I am changing the data in one of the text boxes and the 'FormDirty' event fires off. Behind the 'FormDirty' event I have put that would enable a 'save' button.



    If me.Dirty then
    cmdSaveRec.enabled = true
    else
    cmdSaveRec.enabled = false
    End if

    My problem is, which confuses me is that the 'Form Dirty' event is being triggered, however, when this code runs 'me.dirty' is 'FALSE'. How could the form event be triggering the 'dirty' event and then the value of me.dirty be false?

    I am thinking that maybe because the form has 'bound' columns the record is being somehow updated so it triggers the event on the change of data but also saves the record changes so somehow the me.dirty is set to false?
    I am very confused about how/when all the events happen. I thought this would be an easy task just to determine when any record data on the form has been changed.
    Any ideas on what I am doing wrong????
    THansk!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I believe the DirtyEvent only fires once when the record is first dirtied. If you bring up Access Help (not VBA Help) and key in Events, there is quite a bit detail about the order of events.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Losing Records Saved From Form
    By ProgZ in forum Forms
    Replies: 2
    Last Post: 04-17-2011, 11:32 PM
  2. Disallow edits to saved query
    By MWMike in forum Forms
    Replies: 2
    Last Post: 03-08-2011, 09:24 PM
  3. Saved Import in Query
    By Kimbertha in forum Queries
    Replies: 1
    Last Post: 10-21-2010, 07:21 AM
  4. Updating using form bound to a query
    By onechriswhite in forum Forms
    Replies: 5
    Last Post: 07-25-2010, 04:04 AM
  5. Replies: 9
    Last Post: 02-19-2010, 12:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums