M
MechEngr
Ok… while I consider myself to be a real solid beginner with VBA programming,
this question is going to make me look like a real rookie… so I will just
belly up and get it over with.
I have several databases that function beautifully with many complex queries
that allow the user to filter through data with the click of a button. The
queries are tied to open forms using conditions like
“Forms!MyForms![formfield] or Forms!MyForms![formfield] is Null†or
something similar in appropriate query fields.
I have been using a series of queries that cascade into one another so that
after five or so queries, I have captured as many as 20 of these conditional
statements based upon input from the form. I use the last query as the data
source for a list box on the open form(s). In this way the user can narrow
the data search through easy filtering and then use the list box to select a
particular record for display on the form. The series of queries filter my
record set to a particular collection and until I requery the database the
list box will display the current collection.
My questions is: Can I user VB to generate a collection (record set) that
can be tied to the list box on my form without writing to a table or
generating a traditional query (that shows up on the Access query list)? I
know I can use SQL statements and get the record set I want in VB and then
write the data to the form, but can VB generate a collection that is
available to forms and controls just like the standard hard coded queries or
without having to run the VB query every time I click on the List Box?
Sorry if I did not get the DB vernacular correct and thanks for any advise
or instruction you may offer.
this question is going to make me look like a real rookie… so I will just
belly up and get it over with.
I have several databases that function beautifully with many complex queries
that allow the user to filter through data with the click of a button. The
queries are tied to open forms using conditions like
“Forms!MyForms![formfield] or Forms!MyForms![formfield] is Null†or
something similar in appropriate query fields.
I have been using a series of queries that cascade into one another so that
after five or so queries, I have captured as many as 20 of these conditional
statements based upon input from the form. I use the last query as the data
source for a list box on the open form(s). In this way the user can narrow
the data search through easy filtering and then use the list box to select a
particular record for display on the form. The series of queries filter my
record set to a particular collection and until I requery the database the
list box will display the current collection.
My questions is: Can I user VB to generate a collection (record set) that
can be tied to the list box on my form without writing to a table or
generating a traditional query (that shows up on the Access query list)? I
know I can use SQL statements and get the record set I want in VB and then
write the data to the form, but can VB generate a collection that is
available to forms and controls just like the standard hard coded queries or
without having to run the VB query every time I click on the List Box?
Sorry if I did not get the DB vernacular correct and thanks for any advise
or instruction you may offer.