Requery subforms based on queries of query

feathers212

Registered User.
Local time
Today, 16:54
Joined
Jan 3, 2007
Messages
27
I have 4 subforms, each on its own page in a tab control. The tab control is on a MainForm along with several list boxes. The items selected in the list boxes create the Where criteria for a MainQuery (a select query based on the MainTable). Queried off of the MainQuery are 4 individual crosstab queries. These queries are then used to create the subforms.

I have created the coding (based on SQL statements) that creates the MainQuery anytime a value is selected/deselected from any of the list boxes. Up to this point, everything works. The MainQuery is created. However, now I'm stuck on how to get the subforms to show the corresponding updated MainQuery data (through their individual corresponding crosstab queries).
 
How do I go about determining child links?

I create the MainQuery. CrosstabQuery1 (and 2, 3, and 4) are then created from information in the MainQuery. Subform1 (and 2, 3, and 4) were created based on the CrosstabQuery1 (and 2, 3, and 4) (just simple datasheet forms). And then Subform1 (and 2, 3, and 4) are on the MainForm. The Subforms have no direct relationship to anything on the MainForm. In reality, the MainForm is just a way of displaying the data based on "filtered" listbox selections.

I have tried to use
Code:
[Forms]![MainForm]![Subform1].Requery
but no luck. If I manually open the subforms (outside of the MainForm), the correct information is displayed. It is just getting the subforms to automatically update on the MainForm.
 
As an FYI, all of the listboxes (3) and subforms (4) are unbound controls.
 
Anybody have any thoughts? I've tried
Code:
'Forms![Main Form]!Subform1.Form.Refresh
and still no luck
 
Finally, I found the line of code that I need (after much searching, trial & error, and aggrevation!!!!)

Code:
Me.subform1ControlName.SourceObject = "subform1 Form Name"
 

Users who are viewing this thread

Back
Top Bottom