Duplicate data controlling

htadis

Registered User.
Local time
Today, 11:47
Joined
Dec 17, 2014
Messages
61
Hi All,

Would appreciate much if someone could help me on below.

I have a table, when entering data i need to check two fields. If field 1 and field 2 filled with similar data like in the previous records, error msg should appear that filed 1 & 2 are already exist. however, if field 1 is separate from previous data but field 2 is still same, that record should be accepted.

eg.
Record 1 ;
Vehicle name = Toyota
Vehicle number = 1234

if we entered same above data for next record it should not be accepted.

Record 2 ;
Vehicle name = Toyota
Vehicle number = 4231

Here it should be accepted.

Trust you can understand what i wanted to say.

how can i do this ? Do you have any tutorial or previous thread which discussed this point ? pls help me.

thanks
Htadis
 
Hi htadis and welcome to the forum.

Go to design view of the table. Click indexes, opens up an index dialog window. Enter a name for the index, in next column, select Vehicle Name, then sort order. In next row, do not enter a name, in field column enter Vehicle Number, then a sort order. Click back in row containing the index name, at bottom of window, select Yes for Unique.

This gets you started.

Steve.
 
Many thanks Steve for your swift reply. Shall chk and revert if any further query.

thanks !
 
Hi Steve,

many thanks again. it is perfectly working.

one more thing, instead of system error msg, can we arrange to pop up our own msg ?

brgds
Htadis
 

Users who are viewing this thread

Back
Top Bottom