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 2005

Tip: Looking for answers? Try searching our database.

Checking for selection in combo box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy G - 31 May 2005 19:09 GMT
What is the best way to check that a combo box has a selected value?  I need
my clients to select a value first and then click a button.  Before they
click the button I need to check if they have selected anything in the combo
box.

Thanks.
Jeff Conrad - 31 May 2005 19:35 GMT
> What is the best way to check that a combo box has a selected value?  I need
> my clients to select a value first and then click a button.  Before they
> click the button I need to check if they have selected anything in the combo
> box.

Something like so:

Private Sub cmdCheck_Click()
   If IsNull(Me.cboMyComboBox) Then
       ' No value selected
       MsgBox "Please select an item from the list provided " _
       & "before continuing.", vbExclamation, "Select Value"
       Me.cboMyComboBox.SetFocus
   Else
       ' Value selected

       ' Do your other code here
   End If
End Sub

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

 
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.