472,133 Members | 1,278 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

Auto-populate second table based on combobox selection

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
2 3210
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

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.

Similar topics

1 post views Thread by Lew | last post: by
5 posts views Thread by Robert Downes | last post: by
9 posts views Thread by Alan Mackenzie | last post: by
20 posts views Thread by Vijay Kumar R. Zanvar | last post: by
5 posts views Thread by maya | last post: by
22 posts views Thread by nospam_news | last post: by
2 posts views Thread by Piotr K | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.