K
kagard
Greetings:
I have a form with two subforms. When users indicates the records they
want to view, I change the form's recordsource to a SQL statement
representing their selection criteria. Then I requery the form. In
this case, the form returns no records and no errors. Here is the
code:
Private Sub cmdGo_Click()
Dim strSQL As String
strSQL = "SELECT * FROM Distribution WHERE DistID IN " _
& "(SELECT DistID FROM qryFindDistributions);"
Me.RecordSource = strSQL
Me.Requery
End Sub
If I leave the form open, copy and paste the SQL into a new query, and
run it, it returns the appropriate records. Any idea why the form
returns nothing?
TIA
Keith
I have a form with two subforms. When users indicates the records they
want to view, I change the form's recordsource to a SQL statement
representing their selection criteria. Then I requery the form. In
this case, the form returns no records and no errors. Here is the
code:
Private Sub cmdGo_Click()
Dim strSQL As String
strSQL = "SELECT * FROM Distribution WHERE DistID IN " _
& "(SELECT DistID FROM qryFindDistributions);"
Me.RecordSource = strSQL
Me.Requery
End Sub
If I leave the form open, copy and paste the SQL into a new query, and
run it, it returns the appropriate records. Any idea why the form
returns nothing?
TIA
Keith