Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Display Message "Empty" when Combbox1 has no values or rather Empty

  1. #1
    Board Regular
    Join Date
    Sep 2015
    Posts
    323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Display Message "Empty" when Combbox1 has no values or rather Empty

    Anyone

    in user Forfm
    Code:
    Private Sub UserForm_Initialize()
      combobox1.dropstyle =  1-FrmDropButtonStyleArrow
      'when UserForm is Intialized or activated  the 
      combobox1.value = ""   'or  
      combobox1.text = ""
    End Sub

    1. When clicked on above combobox1 or on the arrowbutton of the combobox1 i want a msg that combobox is Empty and the list is also empty and gives the option to select from another combobox2 ----- How to achieve this ?

    I tried the below in Combobox1_Change event nothing worked also in Combobox1_Click Event it did not work

    Code:
    'If cmbProdCode Is Nothing Then
    'If cmbProdCode.ListIndex = -1 Then
    'If cmbProdCode = vbNullString Then
    'If cmbProdCode.Value = "" Then
    '   MsgBox "Empty" , vbOKOnly
    'End If

    Thanks in Advance


    NimishK
    Last edited by NimishK; Nov 30th, 2017 at 08:58 AM.

  2. #2
    Board Regular
    Join Date
    Jul 2012
    Location
    Hampshire, UK
    Posts
    4,371
    Post Thanks / Like
    Mentioned
    10 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Display Message "Empty" when Combbox1 has no values or rather Empty

    Hi,
    try using the controls listcount property and see if this does what you want

    Code:
      If Me.ComboBox1.ListCount = 0 Then
            'do something
            
        Else
        
            'do something else
            
        End If
    Dave

  3. #3
    Board Regular
    Join Date
    Sep 2015
    Posts
    323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Display Message "Empty" when Combbox1 has no values or rather Empty

    Dave

    this also does not work

    NimishK

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •