Results 1 to 2 of 2
  1. #1
    Join Date
    May 2010
    Posts
    23

    Unanswered: Building Dynamic Query for a Custom Report

    Hi guys,

    I have attached a screen shot of a form that I created. I want to use it to help build a dynamic report query.

    I can think of a couple ways to handle this in VBA (both very complex), but wanted some expert advice on the simplest way to approach this situation.

    The query (a SELECT statement) would pull data from several tables, and the results will be exported to an excel file. I have the excel piece already taken care of, I just need to articulate how use VBA and variables to build the SELECT statement based on user selection in the form.
    Attached Thumbnails Attached Thumbnails customreportscreen.jpg  

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    buld your query
    write it to the querydefs object
    then call the report using that query. it deos mena that you need to overwrite the exsiting query

    or

    apply the the filters as part of the report's on open argument

    or write the query on the fly inside the report
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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