Duplicate Entry

  • Thread starter Thread starter rr
  • Start date Start date
R

rr

Hello, I am trying to create a macro that warns a person
if they are re-entering data that is already in the
system. I have a date field and a transaction code field,
basically what I want to do is display a warning message
if the user enters a transaction code AND date that is
already present in the table. Is it easier to use a macro
or is there some other easy way to do this? Any help is
greatly appreciated.

THANK YOU!!!!
 
Don't use macros - use events.

The BeforeUpdate event of the form will fire, last thing before Access saves
a new or edited record into your table. In that event, you could use the
DLookup() function to see if the specified record already exists in the
table. Read-up on events, BeforeUpdate, and DLookup in online help.

HTH,
TC
 
Thanks for responding. I was wondering if you could give
me an example code to start with. I have read the help
that you suggested, however, if I am not proficient at the
event coding so if I had an example code to start with
using the variables that I mentioned before that would be
great. Thanx!!
 
Back
Top