populate subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to fill a subform with query results! The flow should be as follows
first I select an action in a dropdown box, execute a query based on the
action selected, when the 'run query' button is selected.

How would this be done?

TIA!
 
I need to fill a subform with query results! The flow should be as follows
first I select an action in a dropdown box, execute a query based on the
action selected, when the 'run query' button is selected.

How would this be done?

By leaving out a couple of steps... <g>

Rather than executing the query, simply set the Subform's RecordSource
property to the name of the query.

John W. Vinson[MVP]
 
I'm getting the following error when I try to set the recordsource property
to a query in my database:

"The expression you entered refers to an object that is closed or doesn't
exist."

Below is what I have in my AfterUpdate method for my selectbox:

Private Sub Combo36_AfterUpdate()
Me.Child16.Form.RecordSource = "General_query"
End Sub

Combo36 is my selectbox (combobox)
Child16 is my subForm
General_query is the name of my stored query in the db

So when ever I select an option in the combobox on the main form I get the
above error. Could anyone help?

The idea is that I will have selections listed in the combobox and when a
selection is made I will have a If condition in the Afterupdate method to
assign a specific Stored Query to the recordsource property of the subform.
Which then the subform should use that query to run it and display its
contents.

TIA!!!
 
Back
Top