Getting information forma table and putting it in another table via a form

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

Hi all,

Lets say I have a field in a table called [mcode] This
field is populated by a drop down list box in a form, Onc
ethis fioeld is populated I want to have anlther field in
the table populated with the discription form the same
source as the [Mcode]

Here is and example of the Tables:

Table [ Machine ]

Fileds [ mcode ]
[ mdescr ]


Table [ Part ]

Fields [m-mcode]
[m-mdescr]

I populate the [m-mcode] in [Part] populated from a
dropdown box in a form, What I want to do is populate the
[m-mdescr] foeld at the same time.

Thank you,

Jay
 
Hi Jay

A "drop down list box" (combo box) can have multiple columns, and you can
refer to other columns in your code. For example, if mcode is in the first
column (column 0) and mdescr is in column 1, you could say:
Me.[m-mdescr] = Me.[m-mcode].Column(1)

However, this is generally a BAD IDEA. You can easily retrieve the mdescr
corresponding to an m-mcode value by joining the two tables in a query. The
only reason for doing what you want is if BOTH these conditions apply: (a)
the description corresponding to a given mcode will change in the future,
and (b) it is important that the Part table store the description as it was
*at the time the Part record was created.
 
Back
Top