Results 1 to 2 of 2
  1. #1
    AKQTS is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2010
    Posts
    56

    Using a subform Value as a parameter

    I have a from with 2 levels of subforms.



    Main_Form: Order Level

    Sub_Form Level 1: Batch Level (many batches: 1 order)

    Sub_Form Level 2: Part Level (many parts: 1 batch)

    I have an append query to add a part to a batch:
    PARAMETERS [Forms]![Dashboard]![Order_Number] Long;
    INSERT INTO Cleaning_Batch_Sub_Parts ( fkBatchID, Sequence )
    SELECT [Forms]![Dashboard_sub]![pkOrderBatchID] AS Expr4, [Cleaning_Batch_Sub_Parts]![Sequence]+1 AS Expr1
    FROM Device_Cleaning_OrderHead INNER JOIN (Cleaning_Batch_Parameters INNER JOIN Cleaning_Batch_Sub_Parts ON Cleaning_Batch_Parameters.pkOrderBatchID = Cleaning_Batch_Sub_Parts.fkBatchID) ON Device_Cleaning_OrderHead.Order_ID = Cleaning_Batch_Parameters.fkOrderID
    WHERE ((([Cleaning_Batch_Sub_Parts]![fkBatchID])=[Cleaning_Batch_Parameters]![pkOrderBatchID]));



    Where I get hung up at is the [Forms]![Dashboard_sub]![pkOrderBatchID] AS Expr4

    The value pkOrderBatchID is on the subform level 1 and is necessary info for subform level 2 so it knows which batch to put the part into. Whenever i run the query, this value pops-up as a parameter entry and does not automaticaly see which value the subform is on. How do I get this to automatically reference the sub-form level 1 value in the query??

    Thanks

  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,521
    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. Pass Subform filter to subform in report
    By camftm in forum Programming
    Replies: 16
    Last Post: 07-19-2011, 07:12 AM
  2. Parameter query
    By doss13 in forum Queries
    Replies: 1
    Last Post: 06-26-2010, 06:11 AM
  3. Data from one subform to anther subform
    By scotribs in forum Forms
    Replies: 3
    Last Post: 03-09-2010, 09:53 AM
  4. Enter Parameter Value
    By plesser in forum Access
    Replies: 1
    Last Post: 11-08-2008, 10:27 AM
  5. Replies: 1
    Last Post: 12-10-2005, 04:52 PM

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