Record already exists

BoroLee

Registered User.
Local time
Today, 11:57
Joined
Aug 30, 2000
Messages
90
I currently have a form which displays a list of students which can be imported into a table. Some of these students may however already exists in that table.

I want some code so that if i click on a student, and that student already exists in the other table, i get a message saying that the student can't be imported as they exist. The primary key on the table to import to is StudentID, and this field also exists on the import form.

Thanks.
 
When you click on a student, issue a DCOUNT against your other table using the key, if it returns 0, your OK, if it is > 0 at least one record exists with that key.
As one way.
 
You have lost me there
 
IF DCOUNT("YourColumn","YourTable","TableKey = " & YourKey) = 0 then
' Key does not exist
ELSE
' Key does exist
END IF
 

Users who are viewing this thread

Back
Top Bottom