Check to see if a record exist

craigachan

Registered User.
Local time
Yesterday, 20:36
Joined
Nov 9, 2007
Messages
285
I would like help with a macro that looks to see if a record in my database table exists, then if it doesn't it adds a record with my data, but if the records does exist, it stops the routine and sends a message box to prompt if you want to continue with adding a new record.

The problem that I'm having is that my macro errors out when it doesn't find a record. I just want my macro to just see if a record exists or not. Then I can write my Iff statements based on whether it finds our or not. How do I just have my macro check for an record, then if it doesn't exist tell that it doesn't exist and not stop my macro. Is there some kind of IfExist() function or something?

Thanks for any help anyone can give me.
 
Thanks so much. I had a mental block for some reason. I'm sure this will solve my problem.
 
Thanks Pat, I still wanted to do it within a macro and it worked very well. I used your Dlookup in the condition field of the macro. It works great. Thanks.
 

Users who are viewing this thread

Back
Top Bottom