GOTO duplicate record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table [tblEvents], a form [frmEvents] based off of the table and a
text box [TicketNo]. TicketNo on my tabel is Yes (No Duplicates) because our
ticket numbers are non duplicating and each event has only one ticket number,
but the filled out form (paper form filled out by loaders) comes to our
office at different times of the day sometime a couple of days apart. My
problem is we don't get the error message until we completely fill out the
form an tab to the next record and then we have to do a search to find the
record we just entered.

Would like to be redirected to the duplicate so we can update it or enter a
new Ticket No. and proceed from there.
 
Use a DLookup() function in the BeforeUpdate event of your TicketNo control
to see if it is a duplicate number. Post back if you need further assistance.

I have a table [tblEvents], a form [frmEvents] based off of the table and a
text box [TicketNo]. TicketNo on my tabel is Yes (No Duplicates) because our
ticket numbers are non duplicating and each event has only one ticket number,
but the filled out form (paper form filled out by loaders) comes to our
office at different times of the day sometime a couple of days apart. My
problem is we don't get the error message until we completely fill out the
form an tab to the next record and then we have to do a search to find the
record we just entered.

Would like to be redirected to the duplicate so we can update it or enter a
new Ticket No. and proceed from there.
 
Use the AfterUpdate event procedure of the TicketNo text box to DLookup()
the table and see if there is another record with the same value.

If so, Undo the form, and go to that record by using FindFirst in the form's
RecordsetClone and setting the Bookmark.

If you need help with DLookup():
http://allenbrowne.com/casu-07.html

Having found the key value, here's an example of moving to a record using
FindFirst and Bookmark:
http://allenbrowne.com/ser-03.html
 
Back
Top