How do I put an array into a combobox

  • Thread starter Frits.van Leeuwen
  • Start date
F

Frits.van Leeuwen

Hello,

I'm using MS Access 2007. I've made a form with a field for a number. This
is needed to create an array.
So I have an array from 1 to the number I put in.
Then I like to show this array in a combobox so I can give a posibility to
select 1 of the numbers.
Who can help me?

Regards,
Frits
 
T

Tom van Stiphout

On Tue, 2 Mar 2010 09:55:52 +0100, "Frits.van Leeuwen"

Here is a hint: a combobox has a RowSourceType property which can be
set to Value List. Then you can set the RowSource property to a string
with semicolon-separated values.

-Tom.
Microsoft Access MVP
 
J

John W. Vinson

Hello,

I'm using MS Access 2007. I've made a form with a field for a number. This
is needed to create an array.
So I have an array from 1 to the number I put in.
Then I like to show this array in a combobox so I can give a posibility to
select 1 of the numbers.
Who can help me?

Regards,
Frits

I'd use an auxiliary table for this. Create a table Num with one Long Integer
field N; fill it with values from 1 to the largest number you'll ever need (be
generous, even 50000 rows is a small table).

Base your combo box on a query:

SELECT N FROM Num WHERE N <= [Forms]![yourform]![numberfield] ORDER BY N;

Requery the combo box in the afterupdate event of the textbox.
 
F

Frits.van Leeuwen

Thanks John for help.
But I do not like to create an table for this.

John W. Vinson said:
Hello,

I'm using MS Access 2007. I've made a form with a field for a number. This
is needed to create an array.
So I have an array from 1 to the number I put in.
Then I like to show this array in a combobox so I can give a posibility to
select 1 of the numbers.
Who can help me?

Regards,
Frits

I'd use an auxiliary table for this. Create a table Num with one Long
Integer
field N; fill it with values from 1 to the largest number you'll ever need
(be
generous, even 50000 rows is a small table).

Base your combo box on a query:

SELECT N FROM Num WHERE N <= [Forms]![yourform]![numberfield] ORDER BY N;

Requery the combo box in the afterupdate event of the textbox.
 
F

Frits.van Leeuwen

Thanks Tom.
It's verry helpful

Tom van Stiphout said:
On Tue, 2 Mar 2010 09:55:52 +0100, "Frits.van Leeuwen"

Here is a hint: a combobox has a RowSourceType property which can be
set to Value List. Then you can set the RowSource property to a string
with semicolon-separated values.

-Tom.
Microsoft Access MVP
 
D

De Jager

Frits.van Leeuwen said:
Hello,

I'm using MS Access 2007. I've made a form with a field for a number. This
is needed to create an array.
So I have an array from 1 to the number I put in.
Then I like to show this array in a combobox so I can give a posibility to
select 1 of the numbers.
Who can help me?

Regards,
Frits
 

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