Results 1 to 3 of 3
  1. #1
    bdicarlo1 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    8

    Question Using Subform entry as criteria in a Query

    Hi,



    I have the following Form and Subform. Form name is "100-Select Form". Subform name is "103-Report Dates". Within the subform I have two fields I'm using, "Start Date" and "End Date'.

    In my query I have a date field. I want the query to read from the Subform (if I open the subform directly my criteria listed below works, but when the main form is open, my query doesn't seem to be able to read from the subform).

    Here is the criteria I have in the date field of my query: >=[Forms]![103-Report Dates]![Start Date] And <=[Forms]![103-Report Dates]![End Date]

    I have a feeling that I somehow should be pointing my criteria first to '100-Select Form', and then to '103-Report Dates' within that form, but I'm just not sure how to write this and nothing I'm trying is working.

    Thanks for any help!
    - Ben

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I always give subform/subreport container control a name different from the object it holds, like: ctr103

    Then:

    BETWEEN [Forms]![100-Select Form]![ctr103]![Start Date] AND [Forms]![100-Select Form]![ctr103]![End Date]
    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
    bdicarlo1 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    8
    That's getting me MUCH closer to what I'm trying to do....Thank you!!!

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

Similar Threads

  1. Replies: 2
    Last Post: 08-29-2012, 09:44 PM
  2. Navigation subform Query Criteria
    By RayMilhon in forum Queries
    Replies: 2
    Last Post: 08-10-2012, 01:26 PM
  3. Replies: 7
    Last Post: 07-15-2011, 01:58 PM
  4. referencing subform entry in selection query
    By Pielewuiter in forum Forms
    Replies: 22
    Last Post: 11-20-2010, 01:58 PM
  5. Entry into subform
    By lynchoftawa in forum Forms
    Replies: 1
    Last Post: 06-17-2009, 09:28 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