By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,154 Members | 2,405 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,154 IT Pros & Developers. It's quick & easy.

list criteria fields of query

P: n/a
I used the code here:

http://groups.google.com/group/comp....18febe2ab9eda5

to list in all my queries their tables and fields.

Now I'd like to view their criteria for each field as well. Where is
this information located? How do I access it?

Thanks in advance,

Christian

Sep 13 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Thu, 13 Sep 2007 10:00:07 -0700, ch************@yahoo.com wrote:
I used the code here:

http://groups.google.com/group/comp....18febe2ab9eda5

to list in all my queries their tables and fields.

Now I'd like to view their criteria for each field as well. Where is
this information located? How do I access it?

Thanks in advance,

Christian
You could cycle through the queries, then examine it's SQL.
The criteria (if there is any) is the text that follows the word
Where.
Public Sub ShowCriteria()

' Show each Query's SQL
Dim Db As Database
Dim qry As QueryDef
Set Db = CurrentDb

For Each qry In Db.QueryDefs
Debug.Print "Query Name = " & qry.Name
Debug.Print "SQL = " & qry.SQL
Debug.Print "*****"
Next qry
Set Db = Nothing
End Sub
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 13 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.