• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

VBA to identify if there are no options availble in a combobox

Is there VBA to identify if there are no options availble in a combobox?
0
JSSenior
Asked:
JSSenior
1 Solution
 
Rey Obrero (Capricorn1)Commented:
you can check the row source of the combo box, either using the Dcount() function, if zero then it means no options available ,
or opening the rowsource as recordset and testing for recordset EOF=true which means no options
0
 
Jeffrey CoachmanCommented:
Can you explain a bit about how this combobox is being used...

0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
How about this:

Private Sub btnTestCombo_Click()
    If Me.cboTest.ListCount = 0 Then MsgBox "There are no options in the combo box"
End Sub

mx
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now