how to procede if record not found.

T

The Old Guy

wow, i'm back for more advice. the problem I have is that after completing a
search for a specific record and not finding it, how do I get the code to
advance to a new record instead of staying on the last record in the record
set. I'm using the following code to look for a record:

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ProductNumber] = " & Str(Nz(Me![Text5]))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

What I wish to do is give the user the option of re-entering the product
number and trying again or deciding to enter the product as a new product.
Thanks for any help that can be given.

John (aka 'the old guy')
 
J

Jeff Boyce

Another possible approach would be to use a combobox with the existing
"records" listed. That way, you could use the built-in NotInList event to
add a new record ...

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Top