J
judytjones via AccessMonster.com
I have been trying to adapt the Multi-Select list box code (shown by Allen
Browne) to include 2 list box selections. Allen's code loops through the
items selected in an extended listbox to build a wherecondition for the
OpenReport cmd.
I added a second loop for my second listbox, and strung the 2 conditions into
1.
If I set a break point at the openReport line, which is coded as follows
DoCmd.OpenReport strDoc, acViewPreview, wherecondition:=strWhere & " AND " &
strWhere2, OpenArgs:=strDescrip & " " & strDescrip2
the immediate window shows my variables as follows
? strwhere
[DeptID] IN (2,3)
? strwhere2
[mtgType] IN (1,3,11)
? strdescrip
Departments: "RSM Administration", "RSM Activities"
? strdescrip2
Meeting Type: "All Staff", "Safety", "AON Training"
the wherecondition causes error 3071 - "this expression is typed incorrectly,
or is too complex"
given the above, the wherecondition would read as
wherecondition:=[DeptID] IN (2,3) AND [mtgType] IN (1,3,11)
is this NOT a valid wherecondition?
Browne) to include 2 list box selections. Allen's code loops through the
items selected in an extended listbox to build a wherecondition for the
OpenReport cmd.
I added a second loop for my second listbox, and strung the 2 conditions into
1.
If I set a break point at the openReport line, which is coded as follows
DoCmd.OpenReport strDoc, acViewPreview, wherecondition:=strWhere & " AND " &
strWhere2, OpenArgs:=strDescrip & " " & strDescrip2
the immediate window shows my variables as follows
? strwhere
[DeptID] IN (2,3)
? strwhere2
[mtgType] IN (1,3,11)
? strdescrip
Departments: "RSM Administration", "RSM Activities"
? strdescrip2
Meeting Type: "All Staff", "Safety", "AON Training"
the wherecondition causes error 3071 - "this expression is typed incorrectly,
or is too complex"
given the above, the wherecondition would read as
wherecondition:=[DeptID] IN (2,3) AND [mtgType] IN (1,3,11)
is this NOT a valid wherecondition?