N
Neil
I'm having problem setting a parameter in an append query. I want to
optionally use all records or only active records (Inactive field = False).
In the Inactive field of the query, I have this:
0 or [blnIncludeInactives]
If I want to use all records, I set blnIncludeInactives to -1; if I only
want to use active records, I set blnIncludeInactives to 0. Only problem is,
I'm always getting only active records.
I have defined blnIncludeInactives as a query parameter, and set its type to
Yes/No. I'm using the following code to set the parameter and execute the
query:
Set qd = CurrentDB.QueryDefs("qappCustSummary_WantList_All")
qd.Parameters("blnIncludeInactives") = blnWantInactives
qd.Execute dbFailOnError
blnWantInactives is a boolean variable that contains the True/False value to
use here.
I have tried manually replacing blnIncludeInactives with the value "-1" (so
that the criteria reads "0 or -1" instead of "0 or [blnIncludeInactives]"),
and the query worked fine, appending both active and inactive records. So I
know it's not the query itself that's the problem. But I can't set
blnIncludeInactives to -1.
What am I doing wrong?
Thanks!
Neil
optionally use all records or only active records (Inactive field = False).
In the Inactive field of the query, I have this:
0 or [blnIncludeInactives]
If I want to use all records, I set blnIncludeInactives to -1; if I only
want to use active records, I set blnIncludeInactives to 0. Only problem is,
I'm always getting only active records.
I have defined blnIncludeInactives as a query parameter, and set its type to
Yes/No. I'm using the following code to set the parameter and execute the
query:
Set qd = CurrentDB.QueryDefs("qappCustSummary_WantList_All")
qd.Parameters("blnIncludeInactives") = blnWantInactives
qd.Execute dbFailOnError
blnWantInactives is a boolean variable that contains the True/False value to
use here.
I have tried manually replacing blnIncludeInactives with the value "-1" (so
that the criteria reads "0 or -1" instead of "0 or [blnIncludeInactives]"),
and the query worked fine, appending both active and inactive records. So I
know it's not the query itself that's the problem. But I can't set
blnIncludeInactives to -1.
What am I doing wrong?
Thanks!
Neil