Hello, I was wondering how it would be possible to have several whereconditions for opening a report based on a query.
I'm using this for a simple search/filter form and i need to be able to pass 3 fields (discipline,userid,date).
The below code will open the report costcode 11 and defines the discipline.
If [cost code] = "P11"
Then
stDocName = "costcode 11"
DoCmd.OpenReport stDocName, acPreview, stDocName, WhereCondition:=Discipline = [Forms]![Report Maker]![Discipline]
End If
I know that I could add the SQL to my code to produce the query, but i'd rather avoid that for now.
Regards
Samulayo
I'm using this for a simple search/filter form and i need to be able to pass 3 fields (discipline,userid,date).
The below code will open the report costcode 11 and defines the discipline.
If [cost code] = "P11"
Then
stDocName = "costcode 11"
DoCmd.OpenReport stDocName, acPreview, stDocName, WhereCondition:=Discipline = [Forms]![Report Maker]![Discipline]
End If
I know that I could add the SQL to my code to produce the query, but i'd rather avoid that for now.
Regards
Samulayo