Results 1 to 5 of 5
  1. #1
    Kaloyanides is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Arlington, MA
    Posts
    51

    Copy Data from One Subform to another Subform.



    I'm sure this been asked/answered many times before but I can't seem to find the answer.

    I have an order Entry Screen. The Invoice Number is not issued or finalized until the user clicks "Issue Invoice" after all of the items have been entered.

    On the Order Entry Screen I have two subforms. One is for the actual order (items) and the other shows all of the items the customer has purchased in the past. It would be great if the user could click the button next to each previously ordered item and have that item auto populate into the order entry subform. Add the item and then setfocus to the items QTY field.

    frmSalesOrdersSUBitems - Order
    qrySalesInvoiceItems
    frmSalesOrdersSUBTemplate - Previously Purchased Items
    qryCustomerTemplates

    If anyone can help, I'd be very grateful!

    Thanks!

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Can you post a copy of the db
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Kaloyanides is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Arlington, MA
    Posts
    51
    I'm not sure how I would do that being a rookie and all...

    I have a main form that contains two subforms. One on top of each other.

    The top subform is for the order entry.

    The bottom subform displays all of the items the customer has ordered in the past.

    I want to be able to click on an item in the bottom subform and have it automatically inserted into the subform above (the actual order entry subform.)

    It may be a little tricky because the items in the order entry subform do not have an invoice number assigned to them until after the order is complete and the user clicks "Issue Invoice." At that point, the invoice number is generated and assigned to the order and all of the items in the order entry subform (top.)

    Hope this all makes sense.

    This is all I have so far:
    Me!frmSalesOrders.Form!frmSalesOrdersSUBitems.ITEM NUM = Me!frmSalesOrders.Form!frmSalesOrdersSUBTemplate.I TEMNUM
    Me!frmSalesOrders.Form!frmSalesOrdersSUBitems.Invo iceItemQuantity.SetFocus

    This works except when you do more than one item, it always inserts in the same spot (top row of datasheet order entry subform.) It needs to go to the first available line or a new record for each item after the first.

    Thanks!

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I'm not sure how I would do that being a rookie and all...
    Do a "Compact & Repair"
    Compress the dB (create a zip file)
    In a reply, click on the "Go Advanced" button
    Scroll down until you see a button "Manage Attachments". Click on the button.
    Follow the prompts.
    (max Zip file size is 2 MB)

  5. #5
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    A posted db copy might be best (and eventually, the only way to help).
    But if you know how to create the new order, maybe all you need is a double-click even on the subform record and use an append query to write the required values from the history table to the new order table. You might want to explore a double click event on the new order record to remove an item should the user not want a record that was just copied. Either way would likely require a requery of the order subform. As for where it goes in the order, you'd sequence order subform records on whatever field makes sense if necessary, but I don't see why the order of the items wouldn't just follow the sequence as they were entered.
    Last edited by Micron; 05-12-2017 at 05:09 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-25-2016, 01:39 PM
  2. Replies: 7
    Last Post: 07-15-2011, 01:58 PM
  3. copy data from a subform to the main form
    By declanfogarty in forum Programming
    Replies: 1
    Last Post: 06-23-2011, 05:31 AM
  4. Copy subform
    By asterismw in forum Programming
    Replies: 1
    Last Post: 03-11-2011, 02:05 PM
  5. Replies: 2
    Last Post: 03-04-2010, 02:04 PM

Tags for this Thread

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