Null value in primary key

S

Shawn

I have a form which displays all three fields from a
table. Records are selected by use of a combo box. If
the user attempts to edit a current record and leave the
primary key blank, an error message appears stating that
the primary key can not be a null value. How can I make
the field on the form return to its original state after
this error so the user can continue using the Combo Box?

Thanks for any help.
Shawn
 
T

Tom Wickerath

Why not use an autonumber primary key in a hidden text box on your form? This way, your
user never needs to be concerned with a primary key--they'll never see it.

I suppose you could use a Docmd.CancelEvent in VBA code, in the Form's On_Error event
property, but this seems like a kludge.


______________________________________

I have a form which displays all three fields from a
table. Records are selected by use of a combo box. If
the user attempts to edit a current record and leave the
primary key blank, an error message appears stating that
the primary key can not be a null value. How can I make
the field on the form return to its original state after
this error so the user can continue using the Combo Box?

Thanks for any help.
Shawn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top