Edit and find duplicate nummber in field 
Author Message
 Edit and find duplicate nummber in field

Hi!

I want that the user can only input unique code-numbers. Now, if he edit a
record, i can't find out, if this number is unique or not (I have textboxes
connected with data-connection).

Pierre



Tue, 23 Apr 2002 03:00:00 GMT  
 Edit and find duplicate nummber in field
Try the "FindFirst" method:

Using the Data Control, you can find out if a number is already used with:

if the data in question is in a variable NewNum

Data1.Recordset.FindFirst "[FieldName] = '" + NewNum + "'"
if Data1.Recordset.NoMatch then
{NewNum was not found in the database}
Else
{Error message}
end if

Alternately, you can add an index to the database table telling the field to
be unique.  Then the program will generate an error if there is a duplicate
value.  You can use error trapping to procede from there

Quote:
> Hi!

> I want that the user can only input unique code-numbers. Now, if he edit a
> record, i can't find out, if this number is unique or not (I have
textboxes
> connected with data-connection).

> Pierre



Tue, 23 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using a Find Duplicate Query to fill a field on a form

2. Finding duplicate fields?

3. Adding Field to Access db - need to make indexed property of field No Duplicates

4. Finding Duplicate and append unique/ joining 2 tables in Access97

5. Finding Duplicate eMails

6. Finding duplicate records ?

7. Finding Duplicates in ADO recordset

8. Finding Duplicates

9. Finding duplicate files

10. Finding duplicates Excel>Access

11. find duplicates

12. Find Duplicate display names in AD

 

 
Powered by phpBB® Forum Software