Database for Fleets

FleetTJ12

New Member
Joined
Dec 9, 2011
Messages
2
Hi,

I have build a database for our fleet and I am trying to take out some form filling errors. I have a form which has a combo box for VIN#. the form also has other boxes which I want the code to autopopulate. There are sepearte boxes for Year of Manufacture, Model, Make/Brand, Tag, and Department. Everytime an employee picks a Vin# and clicks on it, I want these other boxes to self populate on the form. At the same time I also want these fileds to populate the corresponding fields with the same name in the main table

Any help will be much appreciated, I can write some code for Excel but am very new to Access code and I have Access 2010
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I hope you are intending to just SHOW the other data and not include that in another table since you already have the ID there using the VIN# and storing the data more than once is a violation of Normalization Rules.

You can include the extra information in the combo's row source, make sure the combo's column count property is set to the number of columns in the query, make sure the column widths are set so that you don't see the other info when selecting the VIN# in the combo and then set the controls to SHOW the associated data by using this in their control source:

=[ComboNameHere].[Column](3)

Where 3 is the fourth column (since it is zero-based). Change the number to match the column which you want displayed - as well as the ComboNameHere to your actual combo name.
 
Upvote 0
Welcome to the Board!

Take a look at DLOOKUP in the Access VBE Helpfile.

You can also use a query for the ComboBox's Row Source, and add in the additional fields that you want. Then you reference those columns in your text boxes.

Here's a link to how to use the OnChange event for that:

http://www.techrepublic.com/blog/ms...ext-boxes-based-on-a-combo-box-selection/1330

HTH,

Smitty - that article is flawed in that you shouldn't be using the ON CHANGE event for something like this (or for much of anything for that matter when using a combo box). You should be using the combo's AFTER UPDATE event instead.
 
Upvote 0
Thanks Bob,

I appreciate the heads up.

I should have posted your method, which is what I use as well. I'll go slap myself upside the head now...:)
 
Upvote 0
Thanks for the help, I am still working on this, must be some other glitch. I added the code to the combo box but the text box for year of mfg# does not pick it up. :confused:
 
Upvote 0
Thanks for the help, I am still working on this, must be some other glitch. I added the code to the combo box but the text box for year of mfg# does not pick it up. :confused:

You don't need code in the combo box. Just change the CONTROL SOURCE of the TEXT BOX to refer to the combo's column (like I had originally written).
 
Upvote 0

Forum statistics

Threads
1,215,338
Messages
6,124,357
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top