andy wrote:
I have three things,
1. a form with a combo box on it.
2. A lookup table with 2 fields, RMName and RMmrm.
3. A table with site information including an RM field and an MRM
field.
The combo box is getting its info from the lookup table but only the
RMName is visible. I have the control source set to MRM so that when
an RM name is selected the RMmrm (RM code) goes into the MRM field in
my site table.
What I need to do is when an RM name is selected in the combo box, the
RMmrm goes into the MRM field in my site table
AND I want the RMName to go into the RM field in my site table.
How do I make 2 fields in one combo box go into 2 fields in a table???
Personally, I'd name the MRM field as MRM in both tables, and RMName in
both. It just makes it easier, as far as I'm concerned, when coding to
know what you are referring to.
I see no reason to store the RMName in the table since you can link the
two tables together...but do what you want...it's your app.
What I would do, if I were in your position, is to write the query with
your site table with the MRM table linked to the lookup table and drag
the RMName field to a column...and display that.
Anyway, since your control source on the combo is set to MRM, that's all
you need to do. As far as the name goes, if you absolutely have to
store the name...use the Column feature. Columns start at 0 to the
number of columns minus 1. So if the first col is RMRNum, the second
RMRName, then something like
Me.RMName = Me.ComboRM.Column(1)