Results 1 to 7 of 7
  1. #1
    tagteam is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    501

    Cant get query parameter off form in a tabbed layout

    I am trying to use a field value from a form as a query parameter. The form is a subform in a tabbed navigation.



    I am trying
    [Forms]![frmAssignInvoiceShell]![frmAssignInvoice].[Form]![InvoiceNumber]

    however, this is not working. Is there anything i need to specify that relates to the tab interface?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    Which is your main form name and which is your subform name?

    What you have should work is frmAssignInvoiceShell is the main form and frmAssignInvoice is the subform
    the INVOICENUMBER field must be a valid field on the subform as well

    I tested it and it works both in terms of pulling the correct value and using it as a criteria in a query.

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    and frmAssignInvoice is the subform
    to be more precise - the name of the subform control (often the same but not always)

  4. #4
    tagteam is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    501
    Yes the main form is frmAssignInvoiceShell and the sub form is frmAssignInvoice. I have also double checked that the subform control, which is a text box, is named InvoiceNumber. I also make sure to test the query when the parent and sub form are open and I am on that current tab. Is there any way to test to see if it is actually seeing that form at all of the tab control is causing some kind of problem?

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    you can create a query based on any table (pick a short one just for example purposes)

    then put in a field like:

    canyouseeme: [forms]![formname]![fieldname]

    it will spit back the value that's in the field, you can do this for your subform field (with the proper syntax) to see if it's spitting the information back correctly.

    I suspect you just have something misspelled.

  6. #6
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    or - since the OP appears to have misunderstood my post, perhaps the subform control (i.e. the control which has the subform in it) is spelt differently.

    Also, have you tried using the expression builder to navigate to the required control?

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

    In your expression [Forms]![frmAssignInvoiceShell]![frmAssignInvoice].[Form]![InvoiceNumber]

    the name in red must be the name of the form control containing the subform, not the name of the subform itself. (See Ajax's post #3)

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

Similar Threads

  1. Replies: 1
    Last Post: 10-06-2015, 06:50 AM
  2. Query issue in Tabbed form
    By darshit_goswami in forum Forms
    Replies: 1
    Last Post: 02-05-2015, 01:16 PM
  3. Replies: 2
    Last Post: 01-09-2014, 11:13 AM
  4. Tabbed form
    By leftylee in forum Forms
    Replies: 6
    Last Post: 03-14-2011, 12:45 AM
  5. can a tabbed form be too big? Help!
    By ma t in forum Forms
    Replies: 3
    Last Post: 03-10-2011, 10:03 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