Fred,
Thanks for your help, but I keep getting a Syntax Error on
(((Left([Name],1))<>"~") AND ((MSysObjects.Type)=5))
is 'Name' a variable and I have to type in the names of my queries?
Or am I missing something else.
Thanks again!
----- fredg wrote: -----
If you want the names of all the queries:
Set the combo box Row Source Type property to Table/Query. Set the
Rowsource to:
SELECT MSysObjects.Name FROM MSysObjects WHERE
(((Left([Name],1))<>"~") AND ((MSysObjects.Type)=5)) ORDER BY
MSysObjects.Name;
Set the bound column to 1. Set the ColumnWidths property to 1" Set
the LimitTo List to Yes. Set the AutoExpand to Yes.
Then, if you wanted to run any one particular query, based upon it
being selected in this combo box, code the AfteUpdate event:
DoCmd.OpenQuery Me!ComboName
The Row Source Type must be set to Table/Query.
The Row Source SQL must all be on one line.
Click on the RowSource. Then click on the 3 dots button that appears
on that line.
Delete whatever is already in the Query grid.
Click on the Query View tool button and select SQL View.
Copy and paste the below SQL into the SQL window.
SELECT MSysObjects.Name FROM MSysObjects
WHERE (((Left([Name],1))<>"~") AND ((MSysObjects.Type)=5))
ORDER BY MSysObjects.Name;
MAKE SURE that any extra >'s used by your email reader to show quoted
text is not included in the SQL. (There is only one use of the >
symbol, and is in the <> "~" part of the code.)
Do NOT change Name. It is correct as shown.
If you still have an error it may be that you are missing a reference.
Open any module in Design view.
On the Tools menu, click References.
Click to clear the check box for the type library or object library
marked as "Missing:."
An alternative to removing the reference is to restore the referenced
file to the path specified in the References dialog box. If the
referenced file is in a new location, clear the "Missing:" reference
and create a new reference to the file in its new folder.
See Microsoft KnowledgeBase articles:
283115 'ACC2002: References That You Must Set When You Work with
Microsoft Access'
Or for Access 97:
175484 'References to Set When Working With Microsoft Access' for
the correct ones needed,
and
160870 'VBA Functions Break in Database with Missing References' for
how to reset a missing one.