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

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
 
G

Graham Mandeno

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top