G
Guest
I am trying to generate a report using two combo boxes to select the search
fields and two text boxes to be the search parameters. This search feature
previously had only one fiield selector and one search parameter textbox and
worked OK. Now I am adding a second search parameter to improve searching
results, hence the AND. I have modified the WHERE statement below to filter
the report contents but I am not having success with the syntax. Is there
anything obviously wrong in the strWhere string? B.T.W I have separate
strWhere search strings for the date and number data types and those have the
same error. Also, Any suggestions on how to handle multiple data types
(number, date, and string) for building the strWhere string with two
different search parameters each being able to be any of those three data
types? Thanks in advance for your help.
strWhere = "[" & Me!cboField & "] ='" & Me![tboSearchInformation] & "'" And
"[" & Me!cboField2 & "] ='" & Me![tboSearchInformation2] & "'"
strDocName = "Recycled Interface Report"
'Open the report and use the strWhere string to filter the contents
DoCmd.OpenReport strDocName, acPreview, , strWhere
fields and two text boxes to be the search parameters. This search feature
previously had only one fiield selector and one search parameter textbox and
worked OK. Now I am adding a second search parameter to improve searching
results, hence the AND. I have modified the WHERE statement below to filter
the report contents but I am not having success with the syntax. Is there
anything obviously wrong in the strWhere string? B.T.W I have separate
strWhere search strings for the date and number data types and those have the
same error. Also, Any suggestions on how to handle multiple data types
(number, date, and string) for building the strWhere string with two
different search parameters each being able to be any of those three data
types? Thanks in advance for your help.
strWhere = "[" & Me!cboField & "] ='" & Me![tboSearchInformation] & "'" And
"[" & Me!cboField2 & "] ='" & Me![tboSearchInformation2] & "'"
strDocName = "Recycled Interface Report"
'Open the report and use the strWhere string to filter the contents
DoCmd.OpenReport strDocName, acPreview, , strWhere