Invalid Property Value Error When Clicking on Userform ComboBox

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a combobox that is giving me an "invalid property value" , rather than the list of values, when I click on it. It doesn't break the code, ie I can't debug. I just have an {ok} button. I'm returned to the form, but repeated efforts to click on the combobox results in the same error. The error repeats then as I close the userform with the top right 'X'.

This is the code I am using to create the list for the combobox ...

Rich (BB code):
Private Sub uf8_rin_Change()
    Dim s_rin As String
    Dim rin As Long
    Dim t_row As Long 'target row
    
    If mbEvents Then Exit Sub
    
    s_rin = uf8_prin.Value & uf8_rin
    rin = s_rin * 1
    
    If uf8_rin.Value = "" Then
        With ws_psttemp
            uf8_rin.BackColor = RGB(0, 168, 232)
            uf8_tstat.BackColor = vbWhite
            uf8_d_contract = ""
            uf8_d_start = ""
            uf8_d_end = ""
            uf8_d_event = ""
            uf8_d_league = ""
            uf8_d_cust = ""
            uf8_d_fac = ""
            mbEvents = True
            uf8_tstat = ""
            uf8_cstat = ""
            lr_basedata = ws_data.Cells(ws_data.Rows.count, "A").End(xlUp).row
            For x = 2 To lr_basedata
                uf8_rin.AddItem format(ws_psttemp.Range("T" & x), "000")
            Next x
            Stop
            mbEvents = False
        End With
    Else
        t_row = Application.WorksheetFunction.Match(rin, ws_psttemp.Range("A:A"), 0)
        With ws_psttemp
            uf8_rin.BackColor = vbWhite
            uf8_tstat.BackColor = RGB(0, 168, 232)
            uf8_d_contract = .Range("F" & t_row)
            uf8_d_start = format(.Range("G" & t_row), "h:mm AM/PM")
            uf8_d_end = format(.Range("H" & t_row), "h:mm AM/PM")
            uf8_d_event = " " & .Range("L" & t_row)
            uf8_d_league = " " & .Range("M" & t_row)
            uf8_d_cust = " " & Application.WorksheetFunction.VLookup(.Range("F" & t_row), ws_rd.Range("A:K"), 11, False)
            uf8_d_fac = " " & .Range("C" & t_row) & " " & .Range("D" & t_row)
        End With
    End If
End

I use the same code to set the list of values for that particular combobox in the userform initialization code and I have no problems.

If I step through my code, there are no errors, and the userform pops up. As soon as I click on the combobox, I get the message.

Is anyone able to offer any solution for me?
 
Last edited:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Is the MatchRequired property of the combobox set to True?
 
Upvote 0
Hi Norie ... yes it is. If I can make an assumption ... this should be set to False?
I did so, but am still getting the error upon clicking the combobox. I have notices though, that with setting this property to False, the combobox populates with the first value of the list. This really isn't what I want ... I'd like that combobox to be empty until the user selects one of the dropdown choices.

As one can see, the code posted is an textbox change event.

As mentioned, I have no issue with this textbox on userform initialization. In this testing case, where I am encountering errors, I am forcing this textbox change event by chaning it's value to "" (the preferred value of the textbox). I do this with a commandbutton click.

Code:
Private Sub uf8b_cancel_Click()
   
    Unload uf8b_postcomm        'close this userform
     With uf8_post               'original userform
        .uf8_rin = ""           'change textbox value forcing uf8_rin change event
    End With
End Sub
 
Upvote 0
Why are you 'forcing' events?

Events are meant to be triggered when a user takes some sort of action, eg changes a value, exits a control etc.
 
Upvote 0
The user kinda is changing a value (uf8_rin), through the push of a command button. They are cancelling out a value they previously set, defaulting their initial selection back to an empty state. (ie to start over) . Essentially putting the userform back to it's initial state.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top