0
votes

So kind of annoying because I have tried every suggestion that I have read so far, ut I cannot seem to get my user form combo boxes to be filled via VBA.

I have tried the following methods that seem to work for everyone but me....

 Me.Weeks.List = Array("30", "36", "40")

And....

 With Weeks
     .AddItem "30"
     .AddItem "36"
     .AddItem "40"
 End With

And so far nothing shows up in the userform when I run it. Is there a setting I am missing? Of course these are part of the initialize event. :)

MORE CODE PER REQUEST:

 Private Sub ToolBoxForm_Initialize()

Weeks.Clear
'MORE STUFF

Me.MinAYWeeks.List = Array("30", "36", "40")

'With MinAYWeeks
'    .AddItem "30"
'    .AddItem "36"
'    .AddItem "40"
'End With

'MORE STUFF

 End Sub

There's also stuff that does calculations with the OK button, but nothing that affects the contents of the combobox, just stuff that references the value of the selected option.

Thanks in advance guys

enter image description here

1
What kind of error message do you get? Show a bit more of your code, it's hard to guess with that little information.Tom K.
@Tom I dont get an error message at all. The combo box on the userform doesnt show anything at all. This lead me to think that everything is executing ok, so I sifted through the properties window and messed around with several settings and still nothing. What part of the code would you like to see?Doug Coats
At least everything related to that combobox :)Tom K.

1 Answers

2
votes

In your userform initialize event add your code, but add a reference to the userform (Me.Weeks).

With Me.Weeks
 .AddItem "30"
 .AddItem "36"
 .AddItem "40"
End With

enter image description here