Displaying results from Query in subform

mgillespie21234

Registered User.
Local time
Today, 07:26
Joined
May 7, 2013
Messages
26
So i have a combo box that has a criteria set for the query. I have a search button that runs the query that users click.

What i need to happened is i want the results displayed in the sub form the when query is ran.
 
Set the SQL query or the Resultset to the SubForm's RecordSource...
Code:
Me!subFrmName.Form.RecordSource = "SELECT whateverField FROM theTable WHERE someCondition"
 
So where do i do that? and would it look like this?

Me !LCsub2.Location_SRCH.recordsource = SELECT .... ??? im confused.

My form is called Location_SRCH and the sub form on that form is LCsub2.

why do i need my table name or do i? or do i need to just copy what you have above and put my form and subform names in? i can provide my table names or or wuery name.
 
Could you please show the code you currently have in the Button On Click..
 
Option Compare Database

Private Sub Command12_Click()

End Sub

Private Sub Detail_Click()

End Sub

Private Sub lcsub_AfterUpdate()

End Sub

Private Sub Search_Click()

End Sub
 
I think how i am creating my sub form is wrong

What should i be choosing when it ask for tables and quires and i have select what field i want on my sub form
 
Set the SQL query or the Resultset to the SubForm's RecordSource...
Code:
Me!subFrmName.Form.RecordSource = "SELECT whateverField FROM theTable WHERE someCondition"

Got it working by using me!subform.requery and setting a criteria in the query to use the values from the combo box.
 

Users who are viewing this thread

Back
Top Bottom