0
votes

Here is what I am trying to do:

I have a purchase order form for clothing inventory, with PO Lines as a sub form.

In the subform, I have a combobox called "Garments" (which is generic, like T-shirt, Dress, Pants, etc.) The ID from this result is supposed to filter the details combobox (which holds values like Black/Small; Orange/Large, etc.). The details combobox's RowSource has the following as a criteria: [Forms]![PO DETAILS Subform - New]![cboGarments] which the combo box that I select first.

In the "parent" combobox, I have a macro AfterUpdate, Requery "Child" combobox.

The issue is that when I try to select details, a Parameter window pops up. I can manually input the Garment ID, which gives me the right subset of details. I need the "child" combobox to get the ID from the "Parent" combobox and filter the list that way.

This YouTube video gave excellent instructions, but I think my issue might be subform-related.

https://www.youtube.com/watch?v=I_wwlZofCgk

EDIT:

This issue had to do with which field in the table I was binding the "child" combo box to. I would unbind it, and the filtering worked fine. I bound it back, and the field would prompt for a parameter. I decided to create a combo box from scratch and set the option "Store that value in this field" to the field I needed to populate in the table, then adjusted all the filters/queries. Works like a charm now. I still have no idea what went wrong.

1

1 Answers

0
votes

You can't address a subform directly like this, you must specify the "full path", see http://access.mvps.org/access/forms/frm0031.htm :

Forms!Mainform!Subform1.Form!ControlName

so in your case something like

Forms![PO Mainform]![PO DETAILS Subform - New].Form!cboGarments

Note: [PO DETAILS Subform - New] is the name of the subform control on the main form - usually that's the subform name, but not necessarily.