Q: An array of numbers into a form (table)

  • 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 have a really bad feeling about your table design.

If there are a variable set of indeterminate numbers
associated to a unique product number, then your table
should be designed to have 1 column for the unique product
number and 1 column for 1 number in the set. That way, you
will as many rows in the table for any given product number
as there are numbers in their set.

I think that you are making a load of trouble for yourself
in trying to hold the set of numbers within a single column.

Hope that Helps
Gerald Stanley MCSD
 
Gerald Stanley said:
I have a really bad feeling about your table design.

If there are a variable set of indeterminate numbers
associated to a unique product number, then your table
should be designed to have 1 column for the unique product
number and 1 column for 1 number in the set. That way, you
will as many rows in the table for any given product number
as there are numbers in their set.

I think that you are making a load of trouble for yourself
in trying to hold the set of numbers within a single column.

Hope that Helps
Gerald Stanley MCSD

Hi Gerald

Thanks for your reply.

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
 
Geoff

Your database design is fine as your table 2 contains a
separate row for each number associated to any given product.

The primary key for this table is both columns (assuming
that you cannot have the same number associated to any
given part more than once.

To make the primary key, put the table into Design View,
highlight both rows then press the Key icon.

Then to produce a form to enter this information, first
design a form for the second table, then include that form
as a subform in the form for the first table.

Hope That Helps
Gerald Stanley MCSD
 
Many thanks Gerald

Gerald Stanley said:
Geoff

Your database design is fine as your table 2 contains a
separate row for each number associated to any given product.

The primary key for this table is both columns (assuming
that you cannot have the same number associated to any
given part more than once.

To make the primary key, put the table into Design View,
highlight both rows then press the Key icon.

Then to produce a form to enter this information, first
design a form for the second table, then include that form
as a subform in the form for the first table.

Hope That Helps
Gerald Stanley MCSD
 
Back
Top