Results 1 to 4 of 4
  1. #1
    dimits is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2014
    Location
    Greece
    Posts
    2

    A form that makes multiple entries

    I have two tables in my database. First one called tblProducts (with ID, Product, Price) and a second one called tblSales (with ID, Date, ProductID, Quantity). I need a form to add new entries to tblSales. The form must have one textbox to choose a date and then a list with all the products (from tblProducts) with a textbox to fill the quantity of the the product that was sold that date. I don't know if I made my self clear but I'll try to give you an example below.

    Example:
    Let's say that tblProducts has 2 entries:
    ID Product Price
    1 pr1 10
    2 pr2 12


    The form should be something like this:

    date: 09/06/2014
    pr1:__10_______


    pr2:__12_______


    The data in tblSales after I save should be like this:
    ID Date ProductID Quantity
    1 9/6/2014 1 10
    2 9/6/2014 2 12

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    Surely not every product is associated with every sale?

    The 'list' should be a combobox where user will select the desired product.
    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.

  3. #3
    dimits is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2014
    Location
    Greece
    Posts
    2
    Every day a certain amount of all the products is sold. I want to keep records of the quantity that's been sold. Instead of the user having to input the date and the quantity for each product it would be better if he chose the date just once and then input the quantities. I don't know how easy this can be done or if it is even possible but thank you for your fast reply.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    So the product sale is not tied to a customer or a specific sale receipt? This is just an end of day total?

    Then options are:

    1. pre-create a set of product records for the desired date in tblSales - this can be accomplished with an INSERT SELECT sql action:

    INSERT INTO tblSales(SaleDate, ProductID) SELECT Date() AS SaleDate, ProductID FROM tblProducts;

    code behind a button can run the query

    2. an unbound form and lots of code to save data


    Should not use reserved words as field names. Date is a reserved word.
    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. Replies: 2
    Last Post: 03-05-2014, 12:16 PM
  2. Multiple data entries on a form
    By argsemapp in forum Forms
    Replies: 1
    Last Post: 12-03-2013, 03:04 PM
  3. Importing Multiple entries into a form
    By KayZee08 in forum Import/Export Data
    Replies: 3
    Last Post: 03-12-2013, 01:16 PM
  4. From that makes Multiple records
    By sgp667 in forum Forms
    Replies: 8
    Last Post: 10-12-2012, 06:51 PM
  5. Multiple entries wanted in Form
    By taspangler in forum Access
    Replies: 3
    Last Post: 05-02-2011, 12: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