Cascading Combo Box

deljr15

Registered User.
Local time
Today, 11:59
Joined
May 8, 2013
Messages
10
Hi I am trying to make a form for Purchase Orders. I want to be able to select a vendor on the main form and have it only list the available products in the subform.

Example:

Main form = [Purchase Order]
Sub form = [Purchase Order Data]
Vendor control = cboVendor -- located on main form
Product control = cboProduct -- located on sub form

I have a query on cboProduct to show all products where vendor = cboVendor. As it sits it will work if I hit F9 after a change.

I have also tried setting a requery event in a macro tied to the afterUpdate of cboVendor

I have also tried me.Requery in VBA tied to cboVendor's afterUpdate

If anyone can point out where I went wrong it would me much appreciated

Thanks,

Edit: I have managed to make this work on a single form. I am just lost when involving a subform. I have tried searching but only find info about single forms or controlling the subform as a hole.
 
Last edited:
Thanks I managed to get it working

I just thought I would post my solution for other people

Here is the line of code I used
Code:
Me.[Purchase Orders Data Subform].Form!cboProduct.Requery
Here is a broken down version
Code:
Me.[Subform Controll Name].Form![Controll on Subform].Requery
It seams this could also be done like so
Code:
[Forms]![Main Form Name]![Subform Controll Name].Form![Controll on Subform].Requery
 

Users who are viewing this thread

Back
Top Bottom