Query Query

applebyd

Active Member
Joined
May 27, 2002
Messages
348
I have a Db with about 50 queries appearing in the Query window.

Each of them has a comment about which Rpt they feed.

Is there AnY way of printing the whole query list with the comments?

I've tried the help but to no avail.

Any suggestions welcome.

DaveA
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Does "comment" mean description of Query in properties for that query ?

If so then this may help.

Sub Q_Desc()
Dim i As Integer
Dim qDesc As String, qname As String
For i = 0 To CurrentDb.QueryDefs.Count - 1
qDesc = "No Description"
On Error GoTo noDesc
qname = CurrentDb.QueryDefs(i).Name
qDesc = CurrentDb.QueryDefs(i).Properties("Description").Value
GoTo doLoop
noDesc:
Resume doLoop
doLoop:
Debug.Print qname, qDesc
Next i
End Sub

Regards
Suat

Edited : for variable declaration.
This message was edited by smozgur on 2003-01-23 06:22
 
Upvote 0
The comment is inthe description field.

I have

Name Description Modified Created Type

qry1 Rep Weekstat 01/05/02

etc...

What I want is for these 50 queries the query name and Description.

Thanks

DaveA
 
Upvote 0
Dave,

We are talking about same thing, what I can get by right click on the query and Properties.

Did you try the code what I wrote above ? Because it exactly retrieve the name and description (if Exists) of the query and print into Immediate window.

Suat
 
Upvote 0
Sorry, I didn't realize that you may not know what to do with that code.

Please goto VBA and Insert_Module. You will see a new module will be inserted and have a blank code window in screen now. Then Paste that code into that module in code window. Press Ctrl + G to show immediate window and then run this code by pressing F5 when cursor is located in this code.

You will see all you need would be listed in Immediate window.

Suat
 
Upvote 0
Works fine thanks.

I was hoping (in vain)that Micro**** might
hace an easy way of printing this but....

Thanks Again.
 
Upvote 0
It's my pleasure, Dave.

And maybe Micro**** has a way to do that, but I don't know (and also don't think so). :)

Suat
 
Upvote 0
Dave,

See if Tools>Analyze>Documenter gives you what you want. Once into the Documenter dialog just check those things that you want "documented." It will probably give you more than you want, but its worth a look.

enjoy
 
Upvote 0

Forum statistics

Threads
1,221,507
Messages
6,160,219
Members
451,631
Latest member
coffiajoseph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top