Results 1 to 2 of 2
  1. #1
    Stu Man Do is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2013
    Posts
    1

    Copying info from one subform to another form

    Now before we begin I'm a bit of a newbie with Access! I am trying to create a system that allows a book store to store customer details, stock information and create records about orders by using an orders table and an orders details table so that I can link more than one book into one order.

    The issue I have is that I have created an orders form with an orders details subform where I have used a combo box to fill in certain fields such as title and price per unit. My first problem is that once I enter a book ID via the drop down list - you cannot then change the book ID if for example you had entered the wrong book UNLESS you delete that record and re-enter.

    The second issue I had is that I wanted to be able to show an order history on the customer form based on any records for that customer by the order number and order details table. I had attempted to use the same sub form on the customer form however this just shows all records from the orders table.

    Is there any way to do this? Apologies if this is utterly confusing but I have attached my database for people to have a look at if they wouldn't mind!
    Thanks!
    Stu
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    OrderID field in OrderDetails should not be AutoNumber. This is foreign key field and need to save the OrderID primary key value. Change it to a number (long integer) type. The TransactionID field should be AutoNumber, delete it and recreate or leave it off. It is not needed because OrderDetails does not have child related tables. Will have to remove relationship between Orders and OrderDetails to fix this then re-establish.

    Do not include the OrderDetails table in the main form RecordSource.

    Do not include the Orders table in the subform RecordSource.

    Change the join type of the subform RecordSource from INNER to RIGHT.

    [price of each] textbox should be bound to Price. Set Title and Price textboxes properties Locked Yes and TabStop No.

    TotalPrice calculation should be: [Quantity] * [Price]. Unit price should not be saved to OrderDetails unless there is a chance the price in the Books table will be changed in the future. In which case, will require VBA code to save the unit price.

    Advise no spaces in names.
    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.

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

Similar Threads

  1. Subform not filling in info in table
    By gumbi17 in forum Forms
    Replies: 6
    Last Post: 03-18-2013, 02:21 PM
  2. Replies: 35
    Last Post: 12-21-2011, 02:16 PM
  3. Replies: 3
    Last Post: 01-31-2011, 11:47 AM
  4. copy info in subform as well as main form
    By Coolpapabell in forum Forms
    Replies: 0
    Last Post: 09-30-2009, 10:02 AM
  5. copying data from subform to mainform
    By wasim_sono in forum Forms
    Replies: 0
    Last Post: 03-10-2006, 04:35 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