Hey there! Sign in to join this conversationNew here? Join for free
Turn on thread page Beta
    • Thread Starter
    Offline

    0
    ReputationRep:
    My database is based on A Mooring stock control System.

    i have 3 forms: A 'OrderIN form', A 'SalesOUT form' and a 'Current stock list' form.

    I want a macro which will, when someone orders for example, 'Stock A' in the order form, it will add the quantity bought from the amount in the 'stock list' form. and i want a macro which will take away the stock when a certain item is sold.

    Forms:

    frmOrder;
    StockNo
    StockDescription
    QuantityInStock

    frmSales;
    StockNo
    StockDescription
    QuantityInStock

    frmStock;
    StockNo
    StockDescription
    QuantityInStock

    thankyou for your help. Could you please tell me exactly how to do this. ta.
    Offline

    13
    ReputationRep:
    frmOrder;
    StockNo
    StockDescription
    QuantityInStock


    you don't need the StockDescription and QuantityInStock fields on your form


    you only need one query, for what you're doing
    use an update query

    showing tblOrder and tblStock:

    ok, you've already entered an amount in tblOrder

    so

    show the field QuantityInStock from tblStock in the query

    Update to: [tblStock]![QuantityInStock]-[tblOrder]![AMOUNT-ORDERED]

    *where amount ordered is your field you're using to add a "quantity" to


    this is the important part
    CRITERIA: [tblStock]![StockNo]=[tblOrder]![StockNo]



    that should work



    since, you're entering data into frmOrder which is bounded to tblOrder, that's it, you've added an amount.


    The query I described above would take an amount away from QuantityInStock field.
 
 
 
Poll
“Yanny” or “Laurel”

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.