FindFirst

D

Daniel P

I use the following line to locate a recordset in my tabl

rs.FindFirst "[Project Number] = '" & ProjNum & "'

I would like to generate a message to the user if it can't find that specific record. How is this done

Daniel
 
A

Allen Browne

If rs.NoMatch Then
MsgBox "Not found"
End If

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
Daniel P said:
I use the following line to locate a recordset in my table

rs.FindFirst "[Project Number] = '" & ProjNum & "'"

I would like to generate a message to the user if it can't find that
specific record. How is this done?
 
J

JeffW

Daniel P said:
I use the following line to locate a recordset in my table

rs.FindFirst "[Project Number] = '" & ProjNum & "'"

I would like to generate a message to the user if it can't find that
specific record. How is this done?

'immediately below the FindFirst line
if not rs.nomatch then 'match found
'do something with matching record
else
msgbox("Some text here")
end if

HTH,
Jeff
 

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