Results 1 to 6 of 6
  1. #1
    redhonda9834 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    9

    Report with multiple forms

    Hello All,



    I have an Access report that has a few forms added. Those forms have queries tied to them. When I run the report, I want to add criteria to the form or query that the form is using. Is this possible to do?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you added a form to a report? why? Why wouldn't you create a subreport for your main report? If you did it this way then you could do something like select/enter your criteria on a form and use that to drive the report.

  3. #3
    redhonda9834 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    9
    I think I may of misspoke. I have multiple subform/subreport on my main report.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If you are running your report via a button click from a form you can, on that form, add your selection criteria (text boxes or combo boxes to select items) then use it in the queries driving your report using the syntax:

    [forms]![FORMNAME]![CRITERIAFIELDNAME]

    if you just want your user to type something in (text search)

    you can use criteria like

    like * & [Enter the Last Name] & *

  5. #5
    redhonda9834 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    9
    So you mean something like this in the vba code?

    DoCmd.OpenReport "FWReport", acViewReport, , [Forms]![frmG3Comp]![testName] = "test"

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    No, that looks like you're trying to apply a filter, that might work for the main report but I doubt it for a subreport (never used filters on reports myself) it's more about restricting your data at the query level, as I said it would be in the CRITERIA (in your query) driving the report.

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

Similar Threads

  1. Replies: 4
    Last Post: 05-03-2016, 09:20 PM
  2. Replies: 6
    Last Post: 09-24-2013, 06:02 PM
  3. Replies: 6
    Last Post: 04-04-2013, 05:32 PM
  4. Multiple forms or embedded sub-forms
    By Juicejam in forum Forms
    Replies: 2
    Last Post: 08-23-2011, 07:31 AM
  5. Replies: 0
    Last Post: 03-30-2011, 09:50 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