Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2011

    Unanswered: access - requery when field changes?

    my db has a form that contains multiple fields... one of the fields is a serial number.. i have a bit of vba using dlookup to compare a records serial number against a duplicate query... and flag if it is a duplicate or not... dbforums assisted greatly and it's working... i'd like to add one more feature, when a user enters a new record and fills in the serial number field, when they lose focus and go to another field on that same record, i'd like to update the query with that new serial number and then apply my duplicate test... i've tried adding the same test code on serial number on change, on current... ive tried to docmdrefresh... doesn't work.. i don't quite get the requery function... not sure if that is what i need.... any ideas??
    many thanks!!!

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    This test can be performed in the BeforeUpdate event handler of the control used to input the serial number:
    Private Sub Txt_SerialNumber_BeforeUpDate(Cancel As Integer)
    ' Perform the test here
    End Sub
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts