Q: Entering a list of numbers into a combo box

  • Thread starter Thread starter Geoff Jones
  • Start date Start date
G

Geoff Jones

Hi

Can anybody direct me to an example on how to enter a list of numbers into a
combo box of a form?

What I'm trying to do is as follows:

I have a table with two fields. One field is a unique product number and the
other needs to be a list of numbers (the number of numbers being unknown at
design time). I want the user to be able to enter the numbers, for a
particular product number, into a combo (or list - although I'm not sure the
difference between the two).

Can anybody help?

Thanks

Geoff
 
I think the best way to do this is to have the combo bound to a field,
which will contain the list of numbers, in your data source. This will
be the easiest because when the user adds a number, it will
automatically go into the table.
If your data structure does not lend itself easily to having a bound
field like this, make a separate table for the numbers, and base just
the RowSource of the combo on the table. You will need to handle numbers
addition to the table in code behind the AfterUpdate event of the combo box.
Good luck,
Pavel
 
What I'm trying to do is as follows:
I have a table with two fields. One field is a unique product number and the
other needs to be a list of numbers (the number of numbers being unknown at
design time). I want the user to be able to enter the numbers, for a
particular product number, into a combo (or list - although I'm not sure the
difference between the two).

Can anybody help?

I'm afraid that you may be right and I'm getting the design wrong from the
start. I've only just started Access so any further help you can give me
would be most appreciated.

At present, I have two tables. The first (main) table has three columns (or
fields): The first is the product ID (a number), the second is the product
name (in characters) and the third its price (a double). I have set the
first field to be the primary key.

In the other table, I'm going to try and store the list of numbers
associated with the particular product. I'd originally thought that this
would simply be a table of two fields. The first being the product ID and
the other for the numbers. So, for example, the table would look something
like this:

1 5.675
1 8.456
2 9.33
2 7.456
2 9.334

That is, product 1 has two numbers associated with it i.e. 5.675 and 8.456,
but product 2 has three numbers i.e. 9.33, 7.456 and 9.334.

However, and this is where I expect you to say "you've got it completely
wrong!!!", when I try to close the design window I'm told that I haven't set
the primary key. When I try and set the first column to be such, then I'm
told that there are non-unique values. Sigh!

I'm getting into a terrible muddle. Can you help?

Thanks

Geoff
 
Back
Top