Results 1 to 5 of 5
  1. #1
    liam_898 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    11

    Takeaway from a field

    Hey everyone,



    Upon the completion of a sale, I would like the the 'Quantity' bought to be deducted from the stock level field. This done in a form.

    I have no idea where to start.. been searching on google and couldn't find anything of use.

    I can provide more information if needed of table structure... but basically the sale fields consist of:
    • Sale ID
    • Customer ID
    • Product ID
    • Quantity
    • Sale Price
    • Date


    And the stock level is stored in the product table

    any help or suggestion would be appreciated

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    IMHO I don't think you should be keeping a level of stock because this is a calculation. Take a look at this link for a better way: http://allenbrowne.com/AppInventory.html
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    liam_898 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    11
    Quote Originally Posted by Bob Fitz View Post
    IMHO I don't think you should be keeping a level of stock because this is a calculation. Take a look at this link for a better way: http://allenbrowne.com/AppInventory.html
    Ah, that makes perfect sense! I will give it a go and get back to you and let you know how I got on (I'm not that confident with vba)

    Many thanks bob

  4. #4
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    FYI, "DATE" is a reserved word in Access and shouldn't be used as object names. In addition, "DATE" is not very descriptive. "Date" of what??? Birthday? "Date" Customer joined?? When product entered into table?

    If you used a naming convention you wouldn't run into this problem. Here is a list of reserved words:
    http://allenbrowne.com/AppIssueBadWord.html
    http://office.microsoft.com/en-us/ac...010030643.aspx

    Also, using spaces in names causes problems in coding, queries reports..... See also: http://access.mvps.org/access/tencommandments.htm

  5. #5
    liam_898 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    11
    Quote Originally Posted by ssanfu View Post
    FYI, "DATE" is a reserved word in Access and shouldn't be used as object names. In addition, "DATE" is not very descriptive. "Date" of what??? Birthday? "Date" Customer joined?? When product entered into table?

    If you used a naming convention you wouldn't run into this problem. Here is a list of reserved words:
    http://allenbrowne.com/AppIssueBadWord.html
    http://office.microsoft.com/en-us/ac...010030643.aspx

    Also, using spaces in names causes problems in coding, queries reports..... See also: http://access.mvps.org/access/tencommandments.htm
    Okay, I didn't realise that about the word 'DATE'. But I've been following the well accepted naming convention by Leszynski & Reddick (1994) and all my fields and tables are fully normalised (with underscores) lol. What I stated above was just an example as I didn't really want to be too specific.

    In relation to the question, I decided not to commit to restructuring the tables and relationships as a lot of work has already gone into VBA, forms, queries etc and I would have to edit most for my DB. But next time I'll definitely follow the example provided.

    My solution was to use a simple update query to deduct the quantity bought from from the stock level. I know its not the most efficient means but it works

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

Similar Threads

  1. Replies: 8
    Last Post: 04-13-2012, 12:25 PM
  2. Replies: 16
    Last Post: 04-11-2012, 10:56 AM
  3. Replies: 1
    Last Post: 03-03-2012, 10:17 PM
  4. Replies: 3
    Last Post: 10-03-2011, 02:33 PM
  5. Replies: 9
    Last Post: 12-15-2010, 01:44 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