Results 1 to 3 of 3
  1. #1
    tmartin is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2015
    Posts
    37

    Passing Query Criteria to subform queries?

    I have been given a report that has many sub-forms that each have their own query. Currently the date for the report is fixed to the current date.


    Three of the sub-queries use DatePurchased while the other two use just the Date field. I was trying to assign an alias "mydate to all five to have a common date field
    so that I can pass the query to all five sub-queries.

    e.g.

    mydateatePurchased
    mydate:date

    After this task then I am done so want to get this off my plate. How do I pass criteria to sub-queries for each sub-form?
    Thanks
    Attached Files Attached Files
    Last edited by June7; 05-22-2015 at 10:37 AM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You are using forms as subreports? Don't think I've ever seen that. The disadvantage may be that forms will not grow. If you know the number of records will not exceed the size of form, then maybe okay.

    The issue of applying filter criteria to subform/subreport sounds like same issue discussed in: https://www.accessforums.net/program...tes-49268.html

    Don't really understand 'pass the query to all five sub-queries' - did you mean 'pass criteria'? I don't think the common alias field name will resolve the issue.


    Date is a reserved word and should not use reserved words as names.
    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.

  3. #3
    tmartin is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2015
    Posts
    37
    I resolved the issue by adding a reference in the sub-queries to get the date value from a text box in the form.

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

Similar Threads

  1. Replies: 15
    Last Post: 03-02-2014, 05:15 PM
  2. Query passing to subform
    By drunkenneo in forum Programming
    Replies: 1
    Last Post: 11-20-2013, 06:46 AM
  3. Replies: 9
    Last Post: 05-30-2012, 12:57 AM
  4. Passing Multi Select string to Query criteria
    By oleBucky in forum Queries
    Replies: 4
    Last Post: 05-15-2011, 02:11 PM
  5. Passing form fields criteria to a Query
    By yosik20 in forum Queries
    Replies: 1
    Last Post: 05-12-2011, 04:24 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