Auto Fill field - No answer yet

  • Thread starter Thread starter Fahad
  • Start date Start date
F

Fahad

Hi

I'm using access 2007 and I have a form to enter the products info. the name
of the form is "frmProductInfo".

I have two fields that I want the 2nd field to be filled automatically if
the 1st field have certian value. the 2 fields are from different lookup
tables and no relation between the two tables. the tables are related with
the main table.

example:

1st field name: ProductFamily
2nd field name: ProductCat

if the 1st field value equal one of the following (value1 or value2 or
value3) then the 2nd field should have this value (value A)
if the 1st field value equal one of the following (value4 or value5 or
value6) then the 2nd field should have this value (value B)

1- could you please give me the code I should use to fill the 2nd field
automatically?
2- where should I put that code (i.e. on which field & Active should I put
it)? on 1st field on After Update action or on the 2nd field.

thanks...
 
You have defined a relationship between them when you say that if one field
has a value x then other must have some value Y.
You should relate ProductFamily and ProductCat with a one to many and relate
the one side of that to your main table.
 
Dear Linq Adams & Mike

thank you very much for your help...

the code provided works fine.

many thanks
 
Back
Top