Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2010
    Posts
    134
    Provided Answers: 1

    Unanswered: 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 09:24.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

  3. #3
    Join Date
    Dec 2010
    Posts
    134
    Provided Answers: 1
    Hey thanks for that. why is that not smart in your view?

    To use the querydef object, woudl that need to be VB Code?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

  5. #5
    Join Date
    Dec 2010
    Posts
    134
    Provided Answers: 1
    OK - appreciate the help.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •