Results 1 to 13 of 13
  1. #1
    ashwin09 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    9

    Calculations with a multiple value field


    Hello peeps , I'm new to access programming and I came up with an issue with elaborating a database for a small business unit. My database is complete and everything is functional apart from one small detail. I have a form that controls the "re-supply" of products to the stores. Therefore I need to be able to send multiple products at the same time , and I will need my "stock" table to be readjusted ( I don't necessarily need help on that part if I manage to solve my current issue , I can run an update query , easy-peasy )

    So on my form you can see that I have a field to specify the products I need to resupply ( based on their product id ( PK ) ) and a field where I need to specify the quantity ( non look up/relationship based (I guess) ). Ergo , my goal would be to associate a quantity to the products being delivered. Any suggestions will be welcomed

  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,943
    My advice is to not use multi-value field. I can't see a way to accomplish what you want.
    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
    ashwin09 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    9
    TY for your quick reply dude. I would be grateful if you could give me a concrete suggestion about how I can achieve to do this re-supply form. I need to add multiple products to my form ( all products from the same table) and I need to specify the variable quantities. This is the most simplistic approach to my issue. I imagine that multiple value fields aren't the best way to do it , but so far it's the only solution I've come across.

    TY in advance ~

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    I refuse to even consider multi-value fields as a design option. They violate relational database principles and are difficult to handle.

    However, it did occur to me this morning that could maybe save the quantities into another multi-value field in the same order as the product IDs. But how to structure the data input eludes me.

    Otherwise, you would need another table for OrderDetails, like:

    OrderDetails
    OrderID (foreign key)
    ProductID (foreign key)
    Quantity

    Also, it is contrary to relational database concepts to maintain a 'balance' value in tables. A balance should be a calculation done in a report. So the stock table should not be 'readjusted'.
    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.

  5. #5
    ashwin09 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    9
    I found a way to do it and I wanted to ask if it would be interesting to do so. I used a sub form to do multiple entries of products , and the data entered on specific dates will be transferred to a temporary dump table ( I used an append query , and in criteria I put current date so that all the table containing my stock info is not copied on that dump table , and I use the dump table to "readjust" my stock level , and the dump table is cleared on form enter , and form exit ) The dump table has no relationships attached , no look-up fields or anything. The only issue I have in mind so far is that when I send multiple products on a same delivery order , well , it doesn't appear on the same line.


    EDIT : I don't understand what you mean by "balance" value , unless you are referring to calculated fields.
    I did consider your solution , it should doable but I don't see how I can grab the data sets (ProductID+Quantity) individually later for calculations ( stock readjustment). Moreover I already see an issue when it comes to reporting format ,it will be really hard to read if you have lets say , 30 products ID , ergo , 30 different quantities.

    P.S : I'm french so please excuse my lame English and my troubles to explain my issues correctly. Thank you for your reply , it led the way for me.

  6. #6
    ashwin09 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    9
    Sorry I forgot to attach the table concerned ~ It is in french , so I translated the field names

    This is more about how my data is being organized and displayed , rather than a programming problem .

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    By balance in this case I mean a running net total. You have stock coming in and stock going out, the difference of the totals of these transactions is the stock available. This summation would be done with grouping and aggregate function calcs then the two sums are subtracted. All can be done with queries and presented in a report.
    I don't see how I can grab the data sets (ProductID+Quantity) individually later for calculations ( stock readjustment). Moreover I already see an issue when it comes to reporting format ,it will be really hard to read if you have lets say , 30 products ID , ergo , 30 different quantities.
    As I said, 'adjusting stock' is not conventional approach and as for the reporting issue, if you don't want detail to show that is doable.
    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.

  8. #8
    ashwin09 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    9
    How can I do this specific report format ?

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Would have to know more about your table structure. If you posted project might be able analyse and make suggestion. Or you could examine some template projects for ideas. MS has published projects for inventory and asset tracking. Check out the selection when you open Access for a new project.
    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.

  10. #10
    ashwin09 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    9
    I've attached my entire database , the field names are in French so

    CATEGORIE = CATEGORY
    FOURNISSEUR = SUPPLIERS
    PRODUIT = PRODUCT
    MAGASIN = STORE
    RAVITAILLEMENT = RESUPPLY

    Basically there are 2-3 more tables to come but I won't bother designing more tables until I figure out how to design my resupply table. Once I've got that done I should be able to design the rest pretty much easily. ( *fingers crossed*)

    http://www.2shared.com/file/SBT8IFA4/stationary.html

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Still not clear to me what the PRODUIT and REVITAILLEMENT tables are for and how you intend to use them in your business flow. Since the number type field names are also in French I am not sure what they are for. Why do these tables have quantities? In my design, PRODUIT would be a list of products and info about the products. I might have a quantity field to indicate stock level to maintain. Then I would have junction tables to record transactions of purchases and sales.

    Orders
    OrderNumber
    SupplierID
    DateOrder
    ProductID

    Sales
    SalesNum
    ClientID
    DateSold
    ProductID

    Then I would do queries to summarize data by grouping on the product ID, join these queries on the ProductID and calculate difference for balance of stock.
    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.

  12. #12
    ashwin09 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    9
    Exactly what I did I figured out pretty much everything by myself. Think you haven't clearly understood the aim of this application , it is to control ins and outs stationary from a warehouse to the several stores the company owns. Lets say a store needs cleaning materials like idk , lets say , soap , I will be supplying them from the stock existing in the warehouse. The table "RAVITAILLEMENT" is supposed to translate that process. The "PRODUIT" tables is my list of products , their stock level , their minimum stock level , the stock value , their supplier ( ID_FOURNISSEUR as FK )

    Anyway ty a lot , cheers

  13. #13
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Purchased Merchandise in, Sales Merchandise out or Purchased Supplies in, Requested Supplies out - same process. Still have transactions for in and out. Stock level calculated as needed. This is Inventory control. MS has a template db for that.
    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. Field with multiple entries....?
    By norlo in forum Database Design
    Replies: 1
    Last Post: 05-12-2011, 12:04 PM
  2. Replies: 0
    Last Post: 04-25-2011, 04:11 AM
  3. Replies: 22
    Last Post: 03-15-2011, 07:17 AM
  4. Multiple tables same field
    By gilmania in forum Access
    Replies: 7
    Last Post: 10-15-2010, 04:07 PM
  5. Replies: 1
    Last Post: 12-10-2009, 08: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