PDA

View Full Version : DoCmd.OpenReport WhereCondition prblms


jneff11
05-13-02, 18:33
I am trying to utilize two simple where conditions populated by a click on a listbox and on the second one a query window pops up with my selected variable?

For example I click on a listbox to get the "intPosCrnt" value and then click on another list box to get the "strStat" value. I display the the following string in a label box to see what is happening and it looks great. However, on the DoCmd a window pops up with the value I selected in the second listbox as the query name. Wow, what is happening?

strTest = "APPosID = " & intPosCrnt & " AND AppPos!Status = " & strStat

.DoCmd.OpenReport "AppPosStatus", acViewNormal, , WhereCondition:="" & strTest

EdwardP
05-16-02, 16:42
What's this AppPos!Status in your where condition. I don't think it should be there. Remove AppPos!.

-Ed