Re: Unbound Combobox
- From: fredg <fgutkind@xxxxxxxxxxxxxxx>
- Date: Tue, 20 May 2008 11:30:03 -0700
On Tue, 20 May 2008 11:09:01 -0700, Martin wrote:
I have an unbound combobox control that uses a table as the RowSource, it is
bound to Column 1. I have the Limit To List property set to Yes, but the
user can still bypass the data entry into this box leaving it empty/null.
I have tried using the NotInList event, but that does not prevent leaving
the control empty. Access Help for a Bound combobox suggests using the
Required property of the field, but since my control is unbound, there does
not appear to be a Required property.
Basically, I want to make sure an entry is made and that it matches one of
the values in the pulldown.
Does anyone have any suggestions on how to accomplish this?
Thanks.
Use the Combo NotInList event to require an in-list value selection.
Then to not allow a blank (Null) value, code the Form's BeforeUpdate
event to display a message, cancel the record update, and set focus to
the combo box.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.ComboName) Then
MsgBox "You cannot leave this Combo Box blank."
Cancel = True
Me.ComboName.SetFocus
End If
End Sub
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
- Follow-Ups:
- Re: Unbound Combobox
- From: Martin
- Re: Unbound Combobox
- References:
- Unbound Combobox
- From: Martin
- Unbound Combobox
- Prev by Date: Re: Combo Box Refresh problem
- Next by Date: Re: Using mouse to scroll down a combo list
- Previous by thread: Unbound Combobox
- Next by thread: Re: Unbound Combobox
- Index(es):
Relevant Pages
|