populate multiple fields using a combo box (1 Viewer)

aliasquark

Registered User.
Local time
Today, 04:41
Joined
Dec 2, 2002
Messages
14
I have a Form which populates a table [T-Orders] in Mircosoft Access.

I want to be able to choose products from a query [Q-Products] using a combo box using a field called
Code:
 to populate the [T-Orders] table - then fill in the other fields which are unique to [T-Orders] 

I am finding it hard to work out how to populate more than one field of the [T-Orders] table. So far all I am able to do is populate the field in T-Orders which is also called [Code]. 

So what I guess I am asking for is a way of referencing the other fields in [Q-Orders] using the one selection from the combo box instead of just populating the one field on which the relationship is based on. 

Don't know if this is an SQL problem or simply an Access one, but it is a problem none the less! Any suggestions? 

By the way, the combo box is set up to retrieve all fields that are common to the Query and the Table not just the field [Code], it's just not sending the other values to their related [T-Orders] field. 

Q.
 

bradcccs

Registered User.
Local time
Today, 13:41
Joined
Aug 9, 2001
Messages
461
There are really two issues here.

Firstly, it is important to ask yourself: "Do I really need to store this information again? Or is it appropriate to just look it up when needed?"

If you store only the "code" (or prefably the ID associated with code) you can reference the other details later when required. This way, you can avoid storing repetitive information, and bloating the db unneccessarily.

However (and there is always a however :( )
If you alter the details of code, these alterations will then be referenced by your stored data. ie: if you change the product description, all historical references will return the new description. This can be handy for some details, but data such as prices etc would cause all sorts of problems if you looked up the new price, and not the price from 6 months ago etc.

Thus you need to find a suitable medium. As a general rule, I store the least amount possible a second time unless it needs to be specific to this new record.

Now, how to store (fill in) multiple fields from a combo box.

You can reference other column info by: comboboxname.column(x) - Where x relates to the column number (First column is column(0) - second is column(1) etc)

If you need further clarification, please repost.

Brad.
 

Users who are viewing this thread

Top Bottom