Results 1 to 5 of 5
  1. #1
    Troubled is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2015
    Location
    Cambodia
    Posts
    9

    Limiting data that gets printed in a report


    I'm a raw novice but am creating a database system for a childrens hospital charity. Its going well but now I have got to reports. I have a database with a few thousand entries. I don't want the whole lot every time I run a report. I have built a multi-field search form and it works really well on a query as a stand alone thing. Please can anyone tell me how to incorporate this in a report. I have included the query name as the control source of my report but it doesn't work. It comes up with a box asking me to enter a parameter value instead of displaying my multi-field search form. Please tell me what I'm doing wrong. Many thanks

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    if you look at this link about docmd.openreport

    https://msdn.microsoft.com/en-us/lib.../ff192676.aspx

    you will see there is a parameter for 'where'

    So rather than using parameters in your query, use vba to create the 'where' string

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Just to add to Ajax's suggestion -

    You could incorporate the report generation into the search form. Add a command button to the form to print the report, in which the "Where" part of the Docmd.Openreport command corresponds to the entries on the form.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I concur - I NEVER use dynamic parameterized queries. Here is a tutorial for a search form http://www.allenbrowne.com/ser-62.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Troubled is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2015
    Location
    Cambodia
    Posts
    9
    Thanks very much. Still struggling but not sunk yet. With more proplus and effort I will get there in the end - hopefully

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 06-13-2013, 11:23 AM
  2. Replies: 3
    Last Post: 05-13-2013, 07:06 PM
  3. Hide button on printed report
    By tylerg11 in forum Reports
    Replies: 5
    Last Post: 12-03-2012, 03:20 PM
  4. Missing Data when printed to pdf
    By Dalan in forum Access
    Replies: 3
    Last Post: 10-19-2012, 06:46 AM
  5. Replies: 2
    Last Post: 06-20-2012, 02:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums