If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Dispaly the Query Used On A Report

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-12, 08:19
Raddle Raddle is offline
Registered User
 
Join Date: Dec 2010
Posts: 81
Dispaly the Query Used On A Report

Hi

I would like to add a text box to a report, which just shows the entire query used in the report. I would have thought I could work it out but ...
I saw someone say that a text box with the code =[RecordSource] woudl do it but I have not bee successful.

If I put this in the textbox's Control Source, I get the name of the query used. What I really want, is the entire underlying query that the query used. This is because the query has a short name e.g. exceptions, but there are loads of tables it references.

Any ideas?

Last edited by Raddle; 01-30-12 at 08:24.
Reply With Quote
  #2 (permalink)  
Old 01-30-12, 09:00
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
in my books not smart to display the query but if you want to you could go through the querydef object to find the details of the query and display them as required
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 01-30-12, 09:10
Raddle Raddle is offline
Registered User
 
Join Date: Dec 2010
Posts: 81
Hey thanks for that. why is that not smart in your view?

To use the querydef object, woudl that need to be VB Code?
Reply With Quote
  #4 (permalink)  
Old 01-30-12, 09:43
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
why is it not smart?
becuase its exposing your table design to potentially malicious influences. if the system is only going to be used / viewed by the designer then its less likely going to be an issue.

in my books it serves no purpose, no benefit there for no worth. after all the details to query will at worst be documented in the reports design, at best will be documented in the system docs.

to expose the members of the querydef object, yes that will involve dabbling in VBA
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 01-30-12, 10:02
Raddle Raddle is offline
Registered User
 
Join Date: Dec 2010
Posts: 81
OK - appreciate the help.

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On