dependent fields

T

Tom

Hi all,
I have a table with 2 columns:
ID and product, i.e

1 cd
2 DVD
3 cd-r

also, I have a form with these fields:
Date
Product ID
Name of product
Quantity

I need that when I input i.e "1" in the "Product ID" field, automatically,
the name i.e "cd" will appear in the "Name of product" field.


Thanks in advanced,
Tom
 
D

Daniel

You should not keep the product name in the second table.
This is not the way to do this.

You should turn the productID field to a comboBox that
it's rowsource is: "Select ID,Name From Products" and
it's row width's are 0cm;3cm
This way you only need to pick the product name and the
product ID would be placed in the table.

Daniel
 
T

Tom

Hi Daniel,
Thanks for the quick response.
I think that combo box will not help me here because:
1. I have more then 100 products and I don't want the user to scroll that
much.
2. I have to use a barcode gun for scanning the products.

I know that the field of name is redounded in a way, but i know my users
(They need to see on the monitor what they scanned -:).
that`s why i need that dependecy in thses fields.

Thanks,
Tom
 
K

Kelvin

You can still get this by doing what Daniel said. Create the combo box in
addition to your text box. Set the control source for both to the same
field (ID). Then when the value in the textbox is updated through your
scanner, the combo box will also update automatically since it is set to the
same source. Since this combo box has the ID hidden and the description
visible, you will only see the description in the combo box.

Kelvin
 
Top