I have the following procedure to filter a report.
Private Sub cmdCreateReport_Click()
' The section and sample numbers were chosen by the combo boxes
DoCmd.OpenReport "SampleReport", acViewPreview, , [pvmt_analysis_section_id] = '& Me.cboSectionNo &' "
End Sub
The variable pvmt_analysis_section_id is an integer. The sub is giving me an error message, 3464, saying that there is a data type mismatch.
If I change the statement to
DoCmd.OpenReport "SampleReport", acViewPreview, , "STR([pvmt_analysis_section_id]) = '& Me.cboSectionNo &' "
the procedure works, but the report comes with nothing, even though I know there is a section with that number (because the combo box is queried directly from the table.
Any help would be appreciated.
Private Sub cmdCreateReport_Click()
' The section and sample numbers were chosen by the combo boxes
DoCmd.OpenReport "SampleReport", acViewPreview, , [pvmt_analysis_section_id] = '& Me.cboSectionNo &' "
End Sub
The variable pvmt_analysis_section_id is an integer. The sub is giving me an error message, 3464, saying that there is a data type mismatch.
If I change the statement to
DoCmd.OpenReport "SampleReport", acViewPreview, , "STR([pvmt_analysis_section_id]) = '& Me.cboSectionNo &' "
the procedure works, but the report comes with nothing, even though I know there is a section with that number (because the combo box is queried directly from the table.
Any help would be appreciated.