SQL Statement

  • Thread starter Thread starter Maracay
  • Start date Start date
M

Maracay

Hi Guys,

I have this sql statement, it works but I want to display a message if the
record is not found and continue if record is found, my question is how can I
capture these events, I will really appreciate any help

Thanks

Set rs = db.OpenRecordset( _
"select JobName, DocketGenInfo " & _
"from tblMDocket " & _
"where DocketNumber = " & Me.ComboDocketRef)
 
Maracay -

Test for the end-of-file right after your OpenRecordset. If it is true,
then no records were returned.

IF rs.EOF Then 'no records returned
<message here>
Else
<continue processing>
E
 
One way to do this would be to test the RecordCount for that recordset you
opened.

If the RecordCount is 0, no records were found...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
Back
Top