0

hello experts

rec.Open "select * from tbl where id="& inputted, con, 2, 3

i used the above code to find records and now the real problem occures when a value is inputted and that doesn't exist in the database so in such a case i wanna display en error message

so how to decide whether record found or not

2
Contributors
3
Replies
8
Views
4 Years
Discussion Span
Last Post by AndreRet
0
If rec.EOF = True Or rec.BOF = True Then
    MsgBox "No Records Found."
End If

Your sql statement is also open to errors...

rec.Open "SELECT * FROM tbl WHERE id=" & inputted & "'", con, 2, 3
0

thanks for your reply and your answer

but inpuutted always will be a number thats why i did so ....

0

Ok, no problem then. If this answered your question as to checking if a record has been returned, please mark it as solved, thanx.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.