Results 1 to 10 of 10
  1. #1
    emjhay13 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    5

    Exclamation Calcuated Query for Instock Field

    Hi Everyone
    I would like to ask something regarding the calculated query for Instock field in a Inventory System see details below are the sample format field of my Inventory Transaction Table

    Code:
    Date	TransactionType	Company name	ProducType	ItemDescription	Qty	UOm	Dim	Unit PRice	Total Amount	RefNO	Instock	Remarks
    My Inventory are based on the preset of Microsoft Access Inventory Management.

    I have only three table InventoryTransaction, ProductDetails and Transaction Type and One query table known as Extended InventoryTransaction

    So my Problem was the Instock field, I need to calculate the actual stock of the Item.See details below coding the Instock field

    Code:
    Instock: IIf([InventoryTransaction].[TransactionType]=[”Incoming”],[InventoryTransaction]![Qty],-([InventoryTransaction]![Qty]))
    Translation of the code
    The Transaction Type has a two records only which is the Incoming and Outgoing,
    Incoming item are for the addition stock of the Item while the Outgoing is to decrease the stock of the Item so the purpose of the Instock field is to calculate the update stock,

    The Instock field located at the Extended InventoryTransaction Query,whenever I open the this query . I encounter the First error, which
    is a dialog box open and looking for "incoming" to enter the paramater value.


    I just hit ok to go inside the table.



    I really need your help guys
    I need to finish this Inventory database even though I creating it from the scratch and thank you very much for replying my message.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    You get the parameter prompt because you've bracketed the value. Drop those:

    "Incoming"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    emjhay13 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    5
    HI pbaldy even though i erase the bracket sign Incoming it still looking for Incoming parameter,

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    What is the SQL now?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    emjhay13 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    5
    Pbaldy i didt use any sql command anyway see the codes below

    SELECT InventoryTransaction.*, ProductDetails.*, TransactionType.*, [UnitPrice]*[Qty] AS TotalAmount, IIf([InventoryTransaction].[TransactionType]=[”Incoming”],[InventoryTransaction]![Qty],-([InventoryTransaction]![Qty])) AS Instock
    FROM TransactionType INNER JOIN (ProductDetails INNER JOIN InventoryTransaction ON ProductDetails.ProductID=InventoryTransaction.Item Description) ON TransactionType.TransactionID=InventoryTransaction .TransactionType;

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    That is SQL and you still have brackets around Incoming.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    emjhay13 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    5
    Pbaldy when i try to eliminate the bracket from the sql view i got a new error


  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    What's the actual SQL now? I see some spaces in the SQL you posted before that are either out of place or in a field name that would require it to be bracketed.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    emjhay13 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    5
    I already posted the actual sql up to this comment, i dont know how to remove the bracket i tried everything and i got the same error

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    The brackets around Incoming appear to be fine now, but in the SQL you posted there is a space in "Item Description"; if the field name actually contains the space, it must be bracketed. There's also one here: "InventoryTransaction .TransactionType" which can't be there.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Select Query > Update Query > Table Field
    By tuggleport in forum Queries
    Replies: 2
    Last Post: 08-09-2012, 07:04 AM
  2. Replies: 1
    Last Post: 08-31-2011, 04:03 PM
  3. help in small Instock inventory
    By Nokia N93 in forum Forms
    Replies: 2
    Last Post: 03-20-2011, 01:00 PM
  4. Reduce field size in query field
    By escapades_access in forum Queries
    Replies: 9
    Last Post: 03-13-2011, 12:21 PM
  5. Replies: 3
    Last Post: 04-26-2010, 11:38 AM

Tags for this Thread

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