Results 1 to 4 of 4
  1. #1
    eugzl is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2021
    Posts
    68

    On Dirty event problem


    Hi All.
    I created simple form bounded to table with Form Dirty event to trigger caption contents of buttons. But unfortunately it doesn't work when text or combo boxes are unbound. In case if text box is bounded On Dirty event works fine. If is it possible to trigger caption of buttons in On Dirty event with unbound form control? In case if it is not possible. How code VBA to trigger caption of a button when contents of fields changed?
    Thanks

    OnDirtyEvent.zip

  2. #2
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I added some code, changed a couple of object names and deleted code that didn't need to be there.
    If you click on the "Close" button, the form now closes. When the button caption is Save", the data is saved.

    Hope this is what you want.....
    Attached Files Attached Files

  3. #3
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Just to clarify why you are having the problem.

    The dirty property is triggered (set to true) when something is changed in the underlying record on a form.
    As an unbound text box isn't linked to a recordset, there is no dirty property to capture. Generally you have to use the after update event of the control.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  4. #4
    eugzl is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2021
    Posts
    68
    Hi Steve.
    Thanks a lot. Very helpful. I changed place controls to get effect for trigger buttons. Because AfterUpdate effected for TextBox after press Tab or Enter button. That not need for ComboBox. Also I painted controls in case they validated.
    In the attachment is last version.
    Thanks
    OnDirtyEvent_ Mod1.zip

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

Similar Threads

  1. Replies: 26
    Last Post: 11-19-2021, 08:06 AM
  2. Using Me.Dirty in a BeforeUpdate event procedure.
    By MatthewGrace in forum Programming
    Replies: 3
    Last Post: 11-30-2014, 12:40 PM
  3. Dirty event not activating on Access 2007 form
    By newbieX in forum Programming
    Replies: 4
    Last Post: 06-17-2014, 12:57 PM
  4. Replies: 5
    Last Post: 12-12-2013, 10:13 PM
  5. can anybody explain dirty event to me?
    By RedGoneWILD in forum Programming
    Replies: 3
    Last Post: 08-05-2010, 01:50 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