Results 1 to 5 of 5
  1. #1
    xtrareal22 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    27

    Show how many times an item is sold?

    Hello,I am a beginner.
    I have a transaction form with the fields(TranID,ItemID,Quantity,Date of sale,Price] i added unbound control(textbox) to the form which i want to show me how much of the same item was sold.
    Example I sell coke today so the transaction of coke was once so when i sell coke again i want it to show me that this item has been sold twice.How do I do that?Is it even possible?

  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,642
    You can try a DCount() with a criteria:

    http://access.mvps.org/access/general/gen0018.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    xtrareal22 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    27
    Okay, so i did this for the conrol source
    =DCount("[Stock ID]","Sales Table","[Stock ID]=" & [Forms]![Sales Form]![Stock ID])
    but the problem now is that when i select the ItemId from the combobox and i have inputted data into the other fields,the textbox value is 0 and when i add the same item ID the field is displayed as 1.What do i do so that when i immediately select the itemID the field displays 1 and not 0.

  4. #4
    xtrareal22 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    27
    Never mind it was works good.thank you

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Glad you got it sorted out.
    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. Replies: 9
    Last Post: 04-02-2013, 07:22 AM
  2. Parent Item / Child Item Not Saving Correctly Together
    By Evilferret in forum Programming
    Replies: 6
    Last Post: 08-24-2012, 02:30 PM
  3. Replies: 5
    Last Post: 08-20-2012, 11:16 AM
  4. Replies: 3
    Last Post: 03-28-2012, 06:00 PM
  5. Replies: 3
    Last Post: 08-24-2010, 07:40 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