Help with updating combo-box

bjarvis

New member
Local time
Today, 15:09
Joined
Dec 20, 2000
Messages
6
I have a database for dispatching trucks. On my form I have a combo box where I select the trucking company and then I have a combo box where I select the trucks that belong to that company. I figured out how to make the truck combo box only show trucks that belong to the specific company, but if I go and change the truck company it still shows me the trucks from the previous company. I need the trucks combo box to update if I change the company. Heres my record source for the trucks combo box.

Select [trucks].[trucknumber] FROM trucks where [truckjobs].[company]=[trucks].[companynumber];
 
Use:

Me![Trucks].Requery

in the AfterUpdate event of [Truck Company].

First suggestion only.
 
Thanks for your help. It took me awhile to get it to work but you pointed me in the right direction.
 
Did you do a requery on the 2nd combo box, like

Me![Combo12].Requery

in the AfterUpdate Event for the 1st combo box?

The above works. If you did it differently, could you please tell us how (I need to do exactly the same thing between two combo boxes...)

Thanks,

Doug.
 
I created a macro to requery and then in the truck companies box I referred to the macro in the after update box.
 
Now I have another problem. The form is in datasheet view and I want to be able to have multiple truck companies and trucks. If I add another truck company the form then deletes my previous truck entry because I have the requery event procedure. How can I get it so that it doesn't requery my previous record.
 

Users who are viewing this thread

Back
Top Bottom