Combo box defaults

  • Thread starter Thread starter Tony Wainwright
  • Start date Start date
T

Tony Wainwright

Hi

I have a combo box on a form that when the form opens has a default value.
It has the LimitToList property set to yes. however the user can delete the
default value and then click the ok button which the sends a Null value to
the query. I can trap all this in code but I was wondering if there is a way
to disable this?

Thanks
TJ
 
If the combo is bound to a field in your table, open the table in design
view and set the Required property of the field to Yes.

That avoids the need to use code cancel the BeforeUpdate event of the combo
or undo it in its AfterUpdate event.
 
The only ways to stop the deletion is to lock or disable the control, or
place a Validation Rule on it, or trap the error. There is no way to stop
the user from hitting a backspace or delete key without remapping those keys
or disabling them in the KeyPress or KeyDown events and it is far easier,
and more user-friendly, to just trap the error.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top