G
Guest
What am I doing wrong? I need to filter the contents of a the "Recycled
Interface Report". I am using a combo box named("Field") to select the field
that should be used to filter. I am then using a text box("Search
Information") as the parameter that must be present in the "Field" field of
the data table to show up in the report. I know this must be a syntax
problem. This WHERE statement works fine( 'strWhere = "[Serial Number]='" &
Me![Serial Number] & "'"
) when the search field is fixed as "Serial Number" but when I want to use
the value of the "field" control in the Sub below it errors.
Private Sub Search_Button_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Recycled Interface Report"
strWhere = "Me!Field.Value='" & Me![Search Information] & "'"
DoCmd.OpenReport strDocName, acPreview, , strWhere
End Sub
Any suggestions? Thanks in advance.
Interface Report". I am using a combo box named("Field") to select the field
that should be used to filter. I am then using a text box("Search
Information") as the parameter that must be present in the "Field" field of
the data table to show up in the report. I know this must be a syntax
problem. This WHERE statement works fine( 'strWhere = "[Serial Number]='" &
Me![Serial Number] & "'"
) when the search field is fixed as "Serial Number" but when I want to use
the value of the "field" control in the Sub below it errors.
Private Sub Search_Button_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Recycled Interface Report"
strWhere = "Me!Field.Value='" & Me![Search Information] & "'"
DoCmd.OpenReport strDocName, acPreview, , strWhere
End Sub
Any suggestions? Thanks in advance.