Results 1 to 6 of 6
  1. #1
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085

    Query Criteria on a subform

    I have a data entry form that has a main form and 2 subforms. The main form contains Patient demographic data one of the subforms contain claim data. There can be multiple claims per Patient. I've put a command button on the subform so that the user can print a government form for that claim. The problem is that I can't seem to get the criteria right as it keeps prompting me for the parameter.



    I tried forms!frm_Data_Entry!frm_Claims!claimnumber and forms!frm_claims!claimnumber. Neither works. What am I missing?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    See if this helps:

    Forms Refer to Form and Subform properties and controls

    Another option would be to use a wherecondition instead of criteria:

    BaldyWeb wherecondition
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    I guess I wasn't very clear. The government form to be printed is a report. The report has a query with the criteria = to the claim number which is on the subform. It's that criteria that is giving me an issue. It's a query for a report that uses a field on a subform for the criteria.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    The second technique works for opening reports too, as noted in the link. Or you can leave it like it is and use the first link to determine the correct syntax. The form remains open, right?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Yes it does but I found the problem and it's working now. The form was named frm_Claims which is what I was using but didn't realize that when I put it as a subform on the main form I gave it the name claims. changed that portion and it worked. Thanks for the help.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Ah yes, it has to be the name of the subform control, not the name of the form itself (though often they're the same). Glad you got it working.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 08-30-2014, 10:23 AM
  2. Using Subform entry as criteria in a Query
    By bdicarlo1 in forum Access
    Replies: 2
    Last Post: 11-14-2012, 06:49 PM
  3. Replies: 5
    Last Post: 09-20-2012, 03:27 PM
  4. Navigation subform Query Criteria
    By RayMilhon in forum Queries
    Replies: 2
    Last Post: 08-10-2012, 01:26 PM
  5. Replies: 5
    Last Post: 08-02-2012, 09:44 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