this one helps. I don't believe that you can use a table as a subform, but I do this kind of thing all the time using a subdatasheet based on a table. Try the following: On the main form's Load event, clear the subform by setting MySubForm.SourceObject = "" In the After_Update event of the ComboQueries combobox, set MySubform.Sourceobject equal to the correct subdatasheet. Set the .RecordSource of the subdatasheet to the sql string built from the combobox.
Private Sub Form_Load()
Me.MySubForm.SourceObject = ""
Private Sub ComboQueries_AfterUpdate()
Dim sql As String
Me.MySubForm.SourceObject = Me.ComboQueries.Column(1)
sql = "SELECT * FROM " & Me.ComboQueries.Column(0) & " WHERE Date = " & Me.Combo2.Value
Me.MySubForm.Form.RowSource = sql
Any of those help In a query, reference a form by its name as a member of the Forms collection. And then reference the value of a control on that form using the control name. It should look like this pattern:
WHERE Application.SoftwareID = Forms!Form2!CbProductName;
Private Sub CbProductName_AfterUpdate()
I wish this helpful for you Well, your question is suffering from the XY problem. Because what you really want to do is the following: You want to create a decent store for your combo, using a well-defined model with the meaningful column names you already have in "rateArray", then you define displayField and valueField accordingly, and in onWidgetAttach, just stuff the "rateArray" object into that store using setData.
wish help you to fix your issue I am intrigued by your design. I must say that it's unusual to have a many-to-many relationship between Quotes and Companies, but if that's what you need then go with it! [Edit: Just read your latest comments and I can see why you've done this now.] However I am concerned by the "3 primary keys" in tblCAFQ. I am interpreting this as being a "composite primary key" made up of the three columns AddressID, CompanyID and AddressTypeID, in which case I would expect these three IDs to also be foreign keys to other tables. You have identified that CompanyID and AddressTypeID are indeed foreign keys, pointing to tblCompanyNames and tblAddressType respectively, but you haven't said where AddressID points to. I suspect that AddressID is in fact the primary key and the other two IDs should just be foreign keys. Anyway, that aside, from the information you have posted so far, I think what you need is
Private Sub Combo51_AfterUpdate()
Me.Parent!Address.Form.Filter = "CompanyID = " & Combo51
Me.Parent!Address.Form.FilterOn = True
Me.Parent!Address.Form.Requery 'You might not need this, I can't remember if it happens automatically after setting FilterOn = True
Subform filtering based off multiple parameters (Combobox AND Textbox)