Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    sams is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Location
    Mayrhofen, Tirol, Austria
    Posts
    12

    how can I add multiple records(products) in one (order)form?


    Dear,

    I am new to access 2007, had access 2003 basics at school. Did some additional reading (book: access 2007 for dummies, ms homepage/tutorials, forums) I want to create an sales/inventory database to make my life at work a lot easier! I’ve planned my db, wrote down everything I need. Then I created my tbl’s contacts/customers, products, orders, transactions. I linked the various tbl’s via relationships. Then I created my forms for data-entry. Now I’m stuck on the new-order form! I want to add multiple records (products) to one customer-order. I tried to use a sub-form made from the transaction tbl, but that didn’t work. Could anybody help me out with this problem? All help and advice is appreciated. I added the db that I am working on so you can take a look.

    Thanks in advanced.

    Sam

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Check out this sample database may be this will help. This is a simple databese wit a main form and a subform. The Main Form reflects the order details and the subform records the products, more over it also displays the sub-form total on the main form.

  3. #3
    sams is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Location
    Mayrhofen, Tirol, Austria
    Posts
    12
    thank you very much for your reply.

    that is what i was looking for!
    the only thing is that every new product that i add gives it a new orderID.
    is it possible that i can add multiple products with the same orderID?, which would make it easier to make a report (invoice) from the order and to track customer orders by orderID.

    regards,

    Sam

  4. #4
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    study the database properly. The relationships in particular. ClientId (AutoNmber PK) in the client table is Linked to client Id of Order( Number FK) the Order_ID in the order table is the primary key for ORder table.

    So Follow this Structure.

    Order Main table Linked with Order Sub Form.

  5. #5
    sams is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Location
    Mayrhofen, Tirol, Austria
    Posts
    12
    I got the order form almost working the way I want to, the only problem is when I add more than one product(record) to the customer-order all products change into the last selected product! Does anyone have a solution for this problem? Any advice is appreciated

    Regards,

    Sam

    i added 2 pictures that display the problem.

  6. #6
    sams is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Location
    Mayrhofen, Tirol, Austria
    Posts
    12
    got it to work now

    thanks for the help maximus!

  7. #7
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    This is what I have done. attaching a mdb file for your reference. i have prepared this very similar to what you want. check it out if this solves your problem mark the thread solved.

  8. #8
    sams is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2010
    Location
    Mayrhofen, Tirol, Austria
    Posts
    12
    thanks maximus for all your help.

    i compared my db with the file you posted and it's almost 1 to 1 the same

  9. #9
    mcauleyj is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    1
    Hi Maximus,

    I've just found your d'base "orderformproblem" a great solution for a d'base I'm trying to set up. My only issue is I can't tell how you get the order_link_ID in the Order_Sub table to self populate.

    Can you shed any light on this for me please.

    Thanks.

  10. #10
    daveirishman is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Feb 2014
    Posts
    2
    Hi Maximus,

    If u have the time, I would really appreciate if u could share the answer to the above question asked by "mcauley"..
    Your "orderformdatabase" is exactly what I need my database to do for a project I am currently working on, but I currently am at a loss trying to backward engineer exactly how it functions due to my lack of experience.

    Much Appreciated

    David
    Ireland.

  11. #11
    maximus's Avatar
    maximus is offline Expert
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Quote Originally Posted by daveirishman View Post
    Hi Maximus,

    If u have the time, I would really appreciate if u could share the answer to the above question asked by "mcauley"..
    Your "orderformdatabase" is exactly what I need my database to do for a project I am currently working on, but I currently am at a loss trying to backward engineer exactly how it functions due to my lack of experience.

    Much Appreciated

    David
    Ireland.
    Check the Order_sub form. The situation is very simple. This code basically updates the price per unit in the Order_sub form table. This can be done in a simpler way:

    Private Sub ProductsID_AfterUpdate()
    Me.Price = Me.ProductPrice
    End Sub

    Instead of creating qryOrder_sub you can do the following:

    1) Link Product_ID in the Order_Sub Table a Lookup Field and the Source should be Product Table. Make Sure to include all the Fields and hide the Product_ID and the Product price by setting the Column Widths:0;1;0 number of columns should be set to 3.
    2) Make a sub form using Order_Sub table and insert the same in the Order_Main form. Do the necessary linking Order_ID and Order_Link_ID.
    3) Attach the below mentioned code to the After Update Event of Procuct_ID Combo Box in Order Subform:

    Me.Price=Me.ProductsID.Columns(3)

    Note: Check Properties of the ProductsID Combo Box in the Sub Form and make sure to include all the Fields and hide the Product_ID and the Product price by setting the Column Widths:0;1;0 number of columns should be set to 3.

    Let me know if this helped if you need any information or need help with you database feel free to contact me on my email.
    Attached Thumbnails Attached Thumbnails screenshot1.jpg  

  12. #12
    daveirishman is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Feb 2014
    Posts
    2
    Your reply was exactly what I needed Maximus, Thank you my friend!

  13. #13
    deborah kingston is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    1
    you solved my problem too thanks

  14. #14
    mormegil is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    1
    Hello,
    I am also looking now for solution of this problem. I would like to study the solution discussed in this topic, yet I don't know where to find the database posted by Maximus. Could you please help me with this, share it somehow?

  15. #15
    maximus's Avatar
    maximus is offline Expert
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    hello this is maximus. I am a seldom visitor now compared to what I was before when there were only handful of us solving problems. I am happy to see so many talented coders sharing their views. observe the relationship and the query diagram. if you need more help mail me a sample db. I will be glad to help you out.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Create multiple records with 1 form?
    By bergjes in forum Forms
    Replies: 4
    Last Post: 04-14-2010, 06:16 AM
  2. Trying to create multiple records from a form
    By ed_hollywood in forum Forms
    Replies: 4
    Last Post: 04-02-2010, 10:57 PM
  3. Records change order
    By accessbeginner in forum Access
    Replies: 1
    Last Post: 03-18-2010, 06:38 PM
  4. Replies: 4
    Last Post: 01-25-2010, 04:14 PM
  5. Replies: 3
    Last Post: 06-01-2009, 01:41 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