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. Delphi: How to find field value before edit changes

2. Help: Finding Error Field in a DB Insert/Update/Edit Exception

3. Find duplicate records where four or more fields match

4. Find duplicate words within a field?

5. Finding duplicate fields?

6. Finding duplicate fields

7. Edit (Find/Find Again)

8. A challenge: Finding duplicates within a found set!

9. Fix Duplicate fields Rather then Duplicate Records?

10. Problems with IBM-DB2 Version 6.1 - Right of Komma Nummbers when I write with Java

11. Update Vendor_id field to all Caps when Vendor_id field is edited

12. Text Fields inside Edit Fields


 
Powered by phpBB® Forum Software