GOTO duplicate record

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.
 
R

ruralguy via AccessMonster.com

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.
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

not on list 9
Smallest size for subform? 9
Access mdb or SQL Server Back End? 4
Serious Bugs with "compact and repair" 3
if duplicate goto record 3
Update Form Problem 5
Foreign Key 1
Blank Report as Attachment 1

Top