A
Amy E. Baggott
I am trying to build a dialog box that will generate a list of companies
based on certain criteria. I have two queries now, one that lists all
companies and one that excludes companies that are exhibiting in the current
show or have told us they're not going to exhibit in the current show (the
latter list is mostly used to try to get companies to exhibit in the show).
Here's where it gets complicated. I have three different ways you can
filter the data and two sets of fields to choose from. The filters are based
on all companies, selecting companies in a specific category, and selecting
companies in selected states. The two sets of fields are full contact
information for mailing and a much more limited set of data (company ID,
company name, first name, last name, phone, fax, and e-mail) to be used for
broadcast e-mails and faxes. I'm trying to set it up so that the users don't
have to go into the Excel file the procedure generates and remove fields
because I'm trying to standardize the field sets, particulary for the
broadcast fax and email program that we use.
My form has two option groups (one to select the filter and the other to
select mailing or broadcast) and a checkbox for whether to include
exhibitors. Selecting "All companies" in the first group then looks at the
checkbox and the second option group and builds the query accordingly.
Selecting either of the other two options opens a separate dialog box that
allows the user to select either the product category or the state(s),
depending on which option is selected, and forwards the values of the second
option group and the checkbox so that the second dialog box can build the
query with the added information.
So far, if I use a separate query for each possible combination (including
whether or not to include current exhibitors), I would have to write 12
queries. What I want to do is instead have the system build the queries at
runtime based on the two basic queries (all companies or non-exhibiting
companies). But when I try to run the actual code, I keep getting "Item not
found in this collection." What am I doing wrong?
based on certain criteria. I have two queries now, one that lists all
companies and one that excludes companies that are exhibiting in the current
show or have told us they're not going to exhibit in the current show (the
latter list is mostly used to try to get companies to exhibit in the show).
Here's where it gets complicated. I have three different ways you can
filter the data and two sets of fields to choose from. The filters are based
on all companies, selecting companies in a specific category, and selecting
companies in selected states. The two sets of fields are full contact
information for mailing and a much more limited set of data (company ID,
company name, first name, last name, phone, fax, and e-mail) to be used for
broadcast e-mails and faxes. I'm trying to set it up so that the users don't
have to go into the Excel file the procedure generates and remove fields
because I'm trying to standardize the field sets, particulary for the
broadcast fax and email program that we use.
My form has two option groups (one to select the filter and the other to
select mailing or broadcast) and a checkbox for whether to include
exhibitors. Selecting "All companies" in the first group then looks at the
checkbox and the second option group and builds the query accordingly.
Selecting either of the other two options opens a separate dialog box that
allows the user to select either the product category or the state(s),
depending on which option is selected, and forwards the values of the second
option group and the checkbox so that the second dialog box can build the
query with the added information.
So far, if I use a separate query for each possible combination (including
whether or not to include current exhibitors), I would have to write 12
queries. What I want to do is instead have the system build the queries at
runtime based on the two basic queries (all companies or non-exhibiting
companies). But when I try to run the actual code, I keep getting "Item not
found in this collection." What am I doing wrong?