How to do this?..HELP!

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

Hi All

I have a form that is using a combo box to look up
a number in Tbl1 and display related data from Tbl2.
I have that working ok.
My question is: How do I get the three other fields that
show in the combo box during the lookup to display
on my form?
ie; (lookup field)=VIN
other fields to display on form: Year, Make, Model

TIA
Donny
 
In the AfterUpdate event of your combo box, insert the following code to
update the controls on your form for Year, Make and Model:

Me!Year = Me!MyCombo.Column(1)
Me!Make = Me!MyCombo.Column(2)
Me!Model = Me!MyCombo.Column(3)

(In code, combo box columns are numbered starting with 0.)
hth,
 
Cheryl
I don't know if last post made it back to you, but
My problem is that the lookup data is in tbl1 and only displayed in the
Combo box except for the VIN. I tried the code you sent but all I got was a
runtime error. The fileds are not now on the form. How do I get these fields
1) Onthe form, and 2) to display with correct data?
TIA
Donny
 
Donny,

You have indicated that your combo box has VIN, Year, Make and Model - so we
should be ok there.

Now, you will need to add 3 textbox controls to your form to hold Year, Make
and Model. These should be unbound (i.e., not bound to fields in the table
that is the RecordSource of your form), so do not add anything to each
control's Control Source property. Name each of these textboxes Year, Make
and Model, respectively, and the code should run ok.
 
Back
Top