-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The SQL I use to get the names of all the queries in an .mdb is:
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((Left("Name",1))<>"~") AND ((MSysObjects.Flags)<>3 And
(MSysObjects.Flags)<>268435459) AND ((MSysObjects.Type)=5))
ORDER BY MSysObjects.Name;
You can put this in the RowSource property of a ComboBox (remember to
set the RowSourceType to Table/Query). Then in the ComboBox's
AfterUpdate event you can run the query the user selected:
Private Sub cboQueries_AfterUpdate()
If Not IsNull(Me!cboQueries) Then
DoCmd.OpenQuery Me!cboQueries
End If
End Sub
Make sure the bound column of the ComboBox is 1.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQfAUOIechKqOuFEgEQI/rACgt7s3iLgZk8LQiwLaMRM5u6BrjVAAoKLM
CEmzpasyRwo7sat9LbaEmYy6
=Qifo
-----END PGP SIGNATURE-----
Simon Radford via AccessMonster.com wrote:
I have a form which contains a field that collects the MSysObjects list of queries within the system.
Also on this form there is a button that is told to apply the query chosen by the user to a certain second form, however I cant seem to tell the button to select the object.
Currently I have:
SELECT MSysObjects.Name FROM MSysObjects WHERE (((MSysObjects.Name)=Me![Choose Filter]))
Anyone help please !