Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check for existing record
Message
 
To
24/08/2001 08:10:00
General information
Forum:
Microsoft Office
Category:
Access
Miscellaneous
Thread ID:
00548540
Message ID:
00549208
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
>I am new to msaccess and have started building an app using wizards. I am now at a point where I need to add some coding and am not sure where to start. I currently have the user to fill in values (one of which is a unique tracking #) in a form and when they click a command button the values of the form are appended to a table. What I would like to do is check the table to see if that tracking number has been entered yet. If it has, I want to prompt the user "Record exists: Do you wish to overwrite Y/N" Yes will overwrite the values in the record; No will do nothing. If the tracking number has NOT been entered yet the existing code will add it to the table. Any help would be appreciated.

Hi Michael,

Try this:

dim nTrackingNumber as Long

...

nTrackingNumber = 125
if DLookup("TrackingNumber","tblTracking","TrackingNumber"=nTrackingNumber) > 0 then
Igor Gelin
Database Developer
Previous
Reply
Map
View

Click here to load this message in the networking platform