
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