Like Q Msg box if no record found.

  • Thread starter Thread starter KAnoe
  • Start date Start date
K

KAnoe

I use a like Q so the user can lookup a record by SSN. The
SSN is in Text format and the user cant use dashes. If not
record is found I would like a Msg box to come up and not
a blank form. How do I do this?

Also can I make it so the user can do the lookup with or
without the dashes?

Thanks
 
Hi,
You can check the RecordsetClone Count property (on the form you are opening) to see if there are any records.
Use the Replace function to get rid of any dashes before you pass the string as criteria.
Help will show you the syntax. Just replace any dashes with an empty string: ""

HTH
Dan Artuso, MVP
 
Back
Top