how to catch error if no match found?

J

Jimmy

if my SQL is:

SELECT FIRST_NAME FROM TABLE1 WHERE LAST_NAME = 'jones'

id jones does not exist i get the error:

"Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record"

why is this happening and can i fix it easily?
 
D

Douglas J. Steele

What are you doing with that SQL statement? How to handle no match will
vary.
 
D

Douglas J. Steele

Afraid that doesn't tell me anything!

Is the SQL the RecordSource for a form? Is it a RowSource for a combo box or
list box? Are you using it to open a RecordSet in VBA code?
 
J

Jimmy

yeah im thinking i can check for recordset.EOF and if its true, my "error"
is trapped, if its not true then the recordset contains data and i can do
whatever i want with it. but thanks for your help
 
D

Douglas J. Steele

Glad you have a solution that works for you. In the future, though, it
really would be far better if you gave some details of what you're trying to
do, rather than having us try to read your mind!
 

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