A
Allen Davidson
Hi I'm a bit stumped on this one.
I have a subform to display people (FirstName, LastName) The subforms record
source is set to SELECT * FROM qryRespondent.
I want to filter the subform from the mainform so I have code to change the
SQL statement. Problem is the subform does not then show any records.
Code is
Private Sub cmdSave_Click()
Dim strSQL As String
strSQL = "SELECT * FROM tblRespondent "
Me.subSelectedRespondent.Form.RecordSource = strSQL
Me.subSelectedRespondent.Form.Requery
End Sub
subSelectedRespondent is the name of the subform control.
If I dont run this code the subfoerm does showe records. If I chnage the SQL
in the code to point to a table without Firstname, LastName then the subform
displays two columns with #name? in each.
Any ideas? I have similar code working fine elsewhere.
Allen
I have a subform to display people (FirstName, LastName) The subforms record
source is set to SELECT * FROM qryRespondent.
I want to filter the subform from the mainform so I have code to change the
SQL statement. Problem is the subform does not then show any records.
Code is
Private Sub cmdSave_Click()
Dim strSQL As String
strSQL = "SELECT * FROM tblRespondent "
Me.subSelectedRespondent.Form.RecordSource = strSQL
Me.subSelectedRespondent.Form.Requery
End Sub
subSelectedRespondent is the name of the subform control.
If I dont run this code the subfoerm does showe records. If I chnage the SQL
in the code to point to a table without Firstname, LastName then the subform
displays two columns with #name? in each.
Any ideas? I have similar code working fine elsewhere.
Allen