Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

Unbound Combobox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin - 20 May 2008 19:09 GMT
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.
fredg - 20 May 2008 19:30 GMT
> 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
[quoted text clipped - 11 lines]
>
> 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
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Martin - 20 May 2008 20:02 GMT
The form's Before Update event would not work for me, so I  wound up using
the control's On Exit event to check for the null.

Thanks for the suggestion.  

> > 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
[quoted text clipped - 26 lines]
>
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.