PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?SGFycnkgRi4=?=
Guest
Posts: n/a
 
      13th Jul 2007
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
 
Reply With Quote
 
 
 
 
PCLIVE
Guest
Posts: n/a
 
      13th Jul 2007
Try this:

Private Sub CheckBox6_Click()

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

End Sub


HTH,
Paul

"Harry F." <(E-Mail Removed)> wrote in message
news:0A744BE2-FE41-4BC5-A7D3-(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?SGFycnkgRi4=?=
Guest
Posts: n/a
 
      13th Jul 2007
Now I get an error "Method or data member not found".

"PCLIVE" wrote:

> Try this:
>
> Private Sub CheckBox6_Click()
>
> If CheckBox6.Value = True Then
> Me.DropDown1176.Value = a89
> End If
>
> End Sub
>
>
> HTH,
> Paul
>
> "Harry F." <(E-Mail Removed)> wrote in message
> news:0A744BE2-FE41-4BC5-A7D3-(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
PCLIVE
Guest
Posts: n/a
 
      13th Jul 2007
How did you create your ComboBox "DropDown1176"?

"Harry F." <(E-Mail Removed)> wrote in message
news:94019FFB-1BFE-4EA8-AEDA-(E-Mail Removed)...
> Now I get an error "Method or data member not found".
>
> "PCLIVE" wrote:
>
>> Try this:
>>
>> Private Sub CheckBox6_Click()
>>
>> If CheckBox6.Value = True Then
>> Me.DropDown1176.Value = a89
>> End If
>>
>> End Sub
>>
>>
>> HTH,
>> Paul
>>
>> "Harry F." <(E-Mail Removed)> wrote in message
>> news:0A744BE2-FE41-4BC5-A7D3-(E-Mail Removed)...
>> > 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

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?SGFycnkgRi4=?=
Guest
Posts: n/a
 
      13th Jul 2007
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?

"PCLIVE" wrote:

> How did you create your ComboBox "DropDown1176"?
>
> "Harry F." <(E-Mail Removed)> wrote in message
> news:94019FFB-1BFE-4EA8-AEDA-(E-Mail Removed)...
> > Now I get an error "Method or data member not found".
> >
> > "PCLIVE" wrote:
> >
> >> Try this:
> >>
> >> Private Sub CheckBox6_Click()
> >>
> >> If CheckBox6.Value = True Then
> >> Me.DropDown1176.Value = a89
> >> End If
> >>
> >> End Sub
> >>
> >>
> >> HTH,
> >> Paul
> >>
> >> "Harry F." <(E-Mail Removed)> wrote in message
> >> news:0A744BE2-FE41-4BC5-A7D3-(E-Mail Removed)...
> >> > 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
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
PCLIVE
Guest
Posts: n/a
 
      13th Jul 2007
In my first response, that method would be creating the ComboBox from the
Control Toolbox toolbar. I think that may work better.



"Harry F." <(E-Mail Removed)> wrote in message
news:37E55ACE-B7BA-4EA9-9FAC-(E-Mail Removed)...
> 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?
>
> "PCLIVE" wrote:
>
>> How did you create your ComboBox "DropDown1176"?
>>
>> "Harry F." <(E-Mail Removed)> wrote in message
>> news:94019FFB-1BFE-4EA8-AEDA-(E-Mail Removed)...
>> > Now I get an error "Method or data member not found".
>> >
>> > "PCLIVE" wrote:
>> >
>> >> Try this:
>> >>
>> >> Private Sub CheckBox6_Click()
>> >>
>> >> If CheckBox6.Value = True Then
>> >> Me.DropDown1176.Value = a89
>> >> End If
>> >>
>> >> End Sub
>> >>
>> >>
>> >> HTH,
>> >> Paul
>> >>
>> >> "Harry F." <(E-Mail Removed)> wrote in message
>> >> news:0A744BE2-FE41-4BC5-A7D3-(E-Mail Removed)...
>> >> > 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
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?SGFycnkgRi4=?=
Guest
Posts: n/a
 
      13th Jul 2007
:-( I'll do that then. Thanks!

"PCLIVE" wrote:

> In my first response, that method would be creating the ComboBox from the
> Control Toolbox toolbar. I think that may work better.
>
>
>
> "Harry F." <(E-Mail Removed)> wrote in message
> news:37E55ACE-B7BA-4EA9-9FAC-(E-Mail Removed)...
> > 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?
> >
> > "PCLIVE" wrote:
> >
> >> How did you create your ComboBox "DropDown1176"?
> >>
> >> "Harry F." <(E-Mail Removed)> wrote in message
> >> news:94019FFB-1BFE-4EA8-AEDA-(E-Mail Removed)...
> >> > Now I get an error "Method or data member not found".
> >> >
> >> > "PCLIVE" wrote:
> >> >
> >> >> Try this:
> >> >>
> >> >> Private Sub CheckBox6_Click()
> >> >>
> >> >> If CheckBox6.Value = True Then
> >> >> Me.DropDown1176.Value = a89
> >> >> End If
> >> >>
> >> >> End Sub
> >> >>
> >> >>
> >> >> HTH,
> >> >> Paul
> >> >>
> >> >> "Harry F." <(E-Mail Removed)> wrote in message
> >> >> news:0A744BE2-FE41-4BC5-A7D3-(E-Mail Removed)...
> >> >> > 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
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Item To ActiveX ComboBox Daniel Jones Microsoft Excel Programming 17 31st Aug 2009 10:51 PM
ActiveX combobox aqualibra Microsoft Excel Worksheet Functions 1 24th Aug 2008 07:54 AM
Using ActiveX combobox controls... Carmine Microsoft Excel Programming 0 21st Mar 2008 05:18 AM
publish activeX combobox and other activeX control =?Utf-8?B?aXJlbmUgYw==?= Microsoft Excel Programming 0 19th Mar 2007 07:19 AM
Combobox | Activex Controls | Tab gduron Microsoft Excel Discussion 0 3rd May 2006 01:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:23 PM.