T
Todd
I have three multiselect listboxes.
I have coded them in VBA to pull the selections and then open a report (that
has an underlying query) using the WHERE property in the openreport event.
One problem was that my WHERE property has "OR" between each code for the
selected results of each listbox. However, the user may not choose a
selection from every listbox, which ruins the openreport event by resulting
in for ex.
OrgID In (34,343,67) OR OR.
So, I elected to populate 3 invisible text boxes with the results from the
selections of each listbox. I then built an expression in each of the
criteria of the fields in the underlying query for the report to pull the
values from the textboxes on the form when the report opened.
Example: The textbox holds 547,427,38,20 The query criteria for the OrgID
field shows "In ([Forms].[MyForm].[txtOrg])"
Well, the report opens with no records. However, if I enter criteria for the
field in the query to be "In (547,427,38,20)" the report opens fine with the
correct corresponding records. Also, if I only make one selection when the
query criteria set as "In ([Forms].[MyForm].[txtOrg])" the report opens
fine. It is just when I make multiple selections from a single listbox that
the report opens with nothing.
Any ideas? Greatly appreciated.
Todd
I have coded them in VBA to pull the selections and then open a report (that
has an underlying query) using the WHERE property in the openreport event.
One problem was that my WHERE property has "OR" between each code for the
selected results of each listbox. However, the user may not choose a
selection from every listbox, which ruins the openreport event by resulting
in for ex.
OrgID In (34,343,67) OR OR.
So, I elected to populate 3 invisible text boxes with the results from the
selections of each listbox. I then built an expression in each of the
criteria of the fields in the underlying query for the report to pull the
values from the textboxes on the form when the report opened.
Example: The textbox holds 547,427,38,20 The query criteria for the OrgID
field shows "In ([Forms].[MyForm].[txtOrg])"
Well, the report opens with no records. However, if I enter criteria for the
field in the query to be "In (547,427,38,20)" the report opens fine with the
correct corresponding records. Also, if I only make one selection when the
query criteria set as "In ([Forms].[MyForm].[txtOrg])" the report opens
fine. It is just when I make multiple selections from a single listbox that
the report opens with nothing.
Any ideas? Greatly appreciated.
Todd