How can I use VBA to set the value of an ActiveX ComboBox

H

Harry F.

Hi, I have a form with several ActiveX Combo Boxes. I also have some check
boxes. When one checkbox value is true, I want the combobox to default to a
value, but when I put this code in, I get and "Object Not Defined" error
message.

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then

Worksheet.DropDown1176.Value = a89

End If

End Sub


Keep in mind I know Access VBA, but my Excel VBA skills are limited.

Thanks,
Harry
 
P

PCLIVE

Try this:

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then
Me.DropDown1176.Value = a89
End If

End Sub


HTH,
Paul
 
H

Harry F.

It's an ActiveX control....I didn't actually create them, but they are not
from the Form Design menu. Would it be easier for me to recreate all of
these this way?
 
P

PCLIVE

In my first response, that method would be creating the ComboBox from the
Control Toolbox toolbar. I think that may work better.
 
H

Harry F.

:-( I'll do that then. Thanks!

PCLIVE said:
In my first response, that method would be creating the ComboBox from the
Control Toolbox toolbar. I think that may work better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top