By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,034 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,034 IT Pros & Developers. It's quick & easy.

Auto-populate second table based on combobox selection

P: n/a
I hope somebody can help. I can't get into the specifics of my
project, but I'll try to create a simple example:

tblVehicle

* VIN (text box)
* Make (text box)
* Model (text box)

frmRepair

* VIN (cboVIN)
* Make (text box)
* Model (text box)
* Problem (text box)
* Fix (text box)
* Date (date)

tblRepair

* VIN (text box)
* Make (text box)
* Model (text box)
* Problem (text box)
* Fix (text box)
* Date (date)
All of the records in tblVehicle are unique. VIN is the Primary Key.
It has a one-to-many relationship to tblRepair.

frmRepair is to record every time a repair is made to a vehicle
identified in tblVehicle. I have cboVIN set up to select from all of
the records in tblVehicle. This selection is then populated in
tblRepair.

I also want to auto-populate Make and Model in tblRepair. Not just
display them in the form (which I can do), but store the data in the
second table.

Yes, I know that I shouldn't have repeating information in multiple
tables. However, I have reasons for doing so. I have a totally
different software application that would utilize the resulting data
in
tblRepair.

So ... I want to use frmRepair to select the VIN from tblVehicle, and
auto-populate VIN, Make, and Model in tblRepair. VIN works
automatically,
but I don't know what to do for Make and Model.

I apologize if this type of issue has been answered before. I've
tried searching
the news groups and haven't found exactly what I am looking for.

Thanks.

- Ronald
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Set the combo box data source as VIN, Make and Model (you can
hide the Make and Model by setting the width of column 1 and 2
(it's zero based) to 0). When you make your selection in the combo
box assign the other two values to the text boxes
eg ME!txtMake = Me!cboVIN.column(1).

Regards
Kevin

"Ronald" <rn*****@starpower.netwrote in message
news:38**********************************@m3g2000h sc.googlegroups.com...
>I hope somebody can help. I can't get into the specifics of my
project, but I'll try to create a simple example:

tblVehicle

* VIN (text box)
* Make (text box)
* Model (text box)

frmRepair

* VIN (cboVIN)
* Make (text box)
* Model (text box)
* Problem (text box)
* Fix (text box)
* Date (date)

tblRepair

* VIN (text box)
* Make (text box)
* Model (text box)
* Problem (text box)
* Fix (text box)
* Date (date)
All of the records in tblVehicle are unique. VIN is the Primary Key.
It has a one-to-many relationship to tblRepair.

frmRepair is to record every time a repair is made to a vehicle
identified in tblVehicle. I have cboVIN set up to select from all of
the records in tblVehicle. This selection is then populated in
tblRepair.

I also want to auto-populate Make and Model in tblRepair. Not just
display them in the form (which I can do), but store the data in the
second table.

Yes, I know that I shouldn't have repeating information in multiple
tables. However, I have reasons for doing so. I have a totally
different software application that would utilize the resulting data
in
tblRepair.

So ... I want to use frmRepair to select the VIN from tblVehicle, and
auto-populate VIN, Make, and Model in tblRepair. VIN works
automatically,
but I don't know what to do for Make and Model.

I apologize if this type of issue has been answered before. I've
tried searching
the news groups and haven't found exactly what I am looking for.

Thanks.

- Ronald

Jun 27 '08 #2

P: n/a

Thank you very much! I have it working.

- Ronald
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.