R
Ronster
I have a report that is linked to a query that searches for the letter
"A" or "B" in a field called CompanyType. I created a function of
Variant type that holds a variable of Variant type. The variable is
called MySelection. MySelection has 1 of 3 options, it can be "A"
or "C" or Null. "A" and "C" work great but when I want to
search for Null it doesn't work. If I type Is Null directly in query
it displays the few records with no values in CompanyType field, works
ok, but I can't seem to capture a Null value in the MySelection
variable.
Again, these work ok:
MySelection = "A"
MySelection = "C"
I'm using the following command to execute the report:
DoCmd.OpenReport "rptCompanyReport", A_PRINT
I have tried the following but none of these work:
MySelection = Null
MySelection = "Is Null"
MySelection = "<>""A"" or <>""C""
MySelection = "Not""A"" or Not""C""
I know I can create a separate query and/or report to work around this
but is there any way to capture a Null value or not display an "A"
or "B" in my variable?
"A" or "B" in a field called CompanyType. I created a function of
Variant type that holds a variable of Variant type. The variable is
called MySelection. MySelection has 1 of 3 options, it can be "A"
or "C" or Null. "A" and "C" work great but when I want to
search for Null it doesn't work. If I type Is Null directly in query
it displays the few records with no values in CompanyType field, works
ok, but I can't seem to capture a Null value in the MySelection
variable.
Again, these work ok:
MySelection = "A"
MySelection = "C"
I'm using the following command to execute the report:
DoCmd.OpenReport "rptCompanyReport", A_PRINT
I have tried the following but none of these work:
MySelection = Null
MySelection = "Is Null"
MySelection = "<>""A"" or <>""C""
MySelection = "Not""A"" or Not""C""
I know I can create a separate query and/or report to work around this
but is there any way to capture a Null value or not display an "A"
or "B" in my variable?