Duplicate data entry solution

ponneri

Registered User.
Local time
Today, 06:27
Joined
Jul 8, 2008
Messages
102
Hi all.

I have a simple table with about 15 fields and a few hundred records. In my data entry form based on the same table, I need to check if a record already exists.

Using the first two unbound fields on my form that accept a text string and a date, I need to check in the underlying table - if these two values exist as a record. Warn (msgbox) and proceed if the text field is found but not the date, as dates can be more than one as per requirement.

If both are found in one record, it's an obvious duplicate. So, no data entry.

Is Dlookup or Dcount the only solution ? If yes, can someone please guide me with the exact syntax ?

Any help will be greatly appreciated. :)
 
Dcount(http://www.techonthenet.com/access/functions/domain/dcount.php) is the best solution (it will always return a value).

However, I wouldn't do this exactly as you mentioned. I would have a form prior to the input form to do this check. An input for the text field and an input for the date, user enters data and clicks a button. Then it does its check and takes the appropriate action. If the user is able to proceed it also opens up the actual input form with the text field and date values they supplied on prior form input already.
 

Users who are viewing this thread

Back
Top Bottom