N
nkakouros
Dear all,
Please forgive me if this is an obvious query (pun intended), but I'm
an access newbie and I've googled extensively with no success.
My query is:
I have a Microsoft Access Database.
I have created a number of saved queries.
Is it possible to place on a form a drop down combo box (or similar)
that dynamically lists the available saved queries (ie so that if more
saved queries are created, these will appear as well) and make it
possible to select one of these queries and run it?
I've just about managed to show names of Queries, but now stuck...
Dim db As Database, qdf As QueryDef
Set db = CurrentDb
For Each qdf In db.QueryDefs
If Not InStr(qdf.Name, "~sq") > 0 Then ' have no idea why things with
~sq come up, but this filters them!
MsgBox qdf.Name ' seems to list query names on screen.. now what?
End If
Next
Set db = Nothing
So.. how can I get the Query names into a combo box and make it
possible to run a query when selected from this box?
Thanks alot.
nick
Please forgive me if this is an obvious query (pun intended), but I'm
an access newbie and I've googled extensively with no success.
My query is:
I have a Microsoft Access Database.
I have created a number of saved queries.
Is it possible to place on a form a drop down combo box (or similar)
that dynamically lists the available saved queries (ie so that if more
saved queries are created, these will appear as well) and make it
possible to select one of these queries and run it?
I've just about managed to show names of Queries, but now stuck...
Dim db As Database, qdf As QueryDef
Set db = CurrentDb
For Each qdf In db.QueryDefs
If Not InStr(qdf.Name, "~sq") > 0 Then ' have no idea why things with
~sq come up, but this filters them!
MsgBox qdf.Name ' seems to list query names on screen.. now what?
End If
Next
Set db = Nothing
So.. how can I get the Query names into a combo box and make it
possible to run a query when selected from this box?
Thanks alot.
nick