Tuesday, February 14, 2012

DoCmd.OpenReport WhereCondition prblms

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:="" & strTestWhat's this AppPos!Status in your where condition. I don't think it should be there. Remove AppPos!.

-Ed

No comments:

Post a Comment