PC Review


Reply
Thread Tools Rate Thread

combobox increment

 
 
=?Utf-8?B?S25lZURvd24yVXA=?=
Guest
Posts: n/a
 
      16th Oct 2006
Is there a way of using a for/next routine to call a multitude of comboboxes.
i.e, if I have say, 100 comboboxes, something like

combo = combobox & i
for i = 0 to 99
me.cells(rowno,cellno) = combo.value (this being each combo box from
combobox1 onwards)

next i

as opposed to having to type out a routine for each combobox?

Thanks

 
Reply With Quote
 
 
 
 
WhytheQ
Guest
Posts: n/a
 
      16th Oct 2006
I think you'll need to use an object variable and then Set this
variable to each Combobox in turn.
So something more like:

Dim Combo as Object
Dim i as Integer

for i = 0 to 99
set Combo = combo & i
cells(rowno,cellno) = combo.value
next i


(not tested so my throw a bug, but I'm sure it is moving in the correct
direction)

Rgds
J


KneeDown2Up wrote:

> Is there a way of using a for/next routine to call a multitude of comboboxes.
> i.e, if I have say, 100 comboboxes, something like
>
> combo = combo & i
> for i = 0 to 99
> me.cells(rowno,cellno) = combo.value (this being each combo box from
> combobox1 onwards)
>
> next i
>
> as opposed to having to type out a routine for each combobox?
>
> Thanks


 
Reply With Quote
 
=?Utf-8?B?S25lZURvd24yVXA=?=
Guest
Posts: n/a
 
      16th Oct 2006
Ok, thanks for that. It comes back with an error message of Object variable
not set?

I then changed the line ' Set combo = combo & i' to 'Set combo = combobox &
i ' and received a "Object required" error.

"WhytheQ" wrote:

> I think you'll need to use an object variable and then Set this
> variable to each Combobox in turn.
> So something more like:
>
> Dim Combo as Object
> Dim i as Integer
>
> for i = 0 to 99
> set Combo = combo & i
> cells(rowno,cellno) = combo.value
> next i
>
>
> (not tested so my throw a bug, but I'm sure it is moving in the correct
> direction)
>
> Rgds
> J
>
>
> KneeDown2Up wrote:
>
> > Is there a way of using a for/next routine to call a multitude of comboboxes.
> > i.e, if I have say, 100 comboboxes, something like
> >
> > combo = combo & i
> > for i = 0 to 99
> > me.cells(rowno,cellno) = combo.value (this being each combo box from
> > combobox1 onwards)
> >
> > next i
> >
> > as opposed to having to type out a routine for each combobox?
> >
> > Thanks

>
>

 
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
Access Problem: Combobox.setfocus fires combobox.OnClick event Hal Levy Microsoft Access Form Coding 5 31st Jul 2009 03:54 AM
Post-Increment and Pre-Increment Overloading jehugaleahsa@gmail.com Microsoft C# .NET 13 20th Nov 2007 10:34 AM
Increment/Increment letter in alphabetical order =?Utf-8?B?TmVpbCBHb2xkd2Fzc2Vy?= Microsoft Excel Programming 3 25th Jan 2006 09:07 AM
HowTo? shift focus in VBA IDE between Object combobox, procedure combobox, and Code window Malcolm Cook Microsoft Access 0 11th Oct 2005 03:42 PM
Bug: Combobox.dropdown = True during Form.New() causes listbox to be disabled, even though combobox is Enabled. =?Utf-8?B?UmF0a2lsZXk=?= Microsoft Dot NET Framework Forms 1 12th Feb 2004 09:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:44 AM.