Null value in primary key

  • Thread starter Thread starter Shawn
  • Start date Start date
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
 
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
 
Back
Top