G
Guest
Hi all
I expect this is an easy one (when you know how!)
I have a main form with a continuous subform displaying related records. On
the main form I have an "add new record" button which opens up the form in
Add mode. The primary key used for the table on which the main form is based
is a unique string of up to 7 characters.
I need to check to see whether the primary key entered already exists in the
table, and if it does, I need to alert the user with a message box to that
effect. (As things stand at the moment, as soon as the key field is entered,
if a record with that key already exists, the subform displays the related
records. I need to stop this before it happens so the user enters a unique
primary key.)
Access automatically does this check when the user tries to save the
record... but I have several fields below this key field which the user must
complete before trying to save. How can I do an "immediate" check on the
string entered ? (Presumably on the OnUpdate event of the textbox... but
what is the code that is needed?)
TIA
rich
I expect this is an easy one (when you know how!)
I have a main form with a continuous subform displaying related records. On
the main form I have an "add new record" button which opens up the form in
Add mode. The primary key used for the table on which the main form is based
is a unique string of up to 7 characters.
I need to check to see whether the primary key entered already exists in the
table, and if it does, I need to alert the user with a message box to that
effect. (As things stand at the moment, as soon as the key field is entered,
if a record with that key already exists, the subform displays the related
records. I need to stop this before it happens so the user enters a unique
primary key.)
Access automatically does this check when the user tries to save the
record... but I have several fields below this key field which the user must
complete before trying to save. How can I do an "immediate" check on the
string entered ? (Presumably on the OnUpdate event of the textbox... but
what is the code that is needed?)
TIA
rich