I'm having problems using a combo box to filter my subform. I must have something wrong in the code and I can't figure out what it is. I have a combo box with GroupNumbers in it, the box is named GrpNmbrBox. Then I create a string to put my SQL filter statement in. Then I try and reference my subform with Me.SubFormName.Form.RecordSource = StringFilter and I get an error.
It gives me an error, "The Record Source "here it has my SQL statement" based on this form does not exist"
Here's my code.
Claims Inputs is the name of the table. GroupNumber is the field in the table I want to filter by.
It gives me an error, "The Record Source "here it has my SQL statement" based on this form does not exist"
Here's my code.
Code:
Private Sub GrpNmbrBox_AfterUpdate()
Dim strFilter As String
GrpName = DLookup("[GroupName]", "Claims Inputs", "GroupNumber=GrpNmbrBox")
strFilter = "select * from Claims Inputs"
strFilter = strFilter & " where GroupNumber = '" & Me.GrpNmbrBox & "'"
Me.ManualMapSubform.Form.RecordSource = strFilter
End Sub
Claims Inputs is the name of the table. GroupNumber is the field in the table I want to filter by.