Results 1 to 7 of 7
  1. #1
    pbs is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    6

    replacement field value

    Hey,I am fairly new with access 2016, and I have a question.
    It will probably be very simple but I do not know, or I can not find it.
    I have a table article with a field stock (number) and a field blocked (yes / no).
    if the value of the field stock = 0 , I want the field blocked to get the value yes.


    I have a button update with which I can update the article field with a certain value, however I would like to see if the stock field gets the value 0, the field blocked automatically get de the value yes.

    Private Sub update_Click ()Stock =0
    Stock = Stock + Plus - Minus
    Plus = 0
    Minus = 0
    End Sub


    Is this possible

    thanks in advance

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    It might be helpful if you could tell us a little more about your database to help put your question into context. Readers may be able to give more focused answers if you could tell us in plain English what subjects your proposed database deals with. I see stock, but do you have Customers, Products, Categories??? Just trying to learn more.

  3. #3
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Assuming you have already done whatever to set the values of the Stock fields to 0, maybe a query like
    UPDATE tblArticle SET tblArticle.Blocked = True WHERE tblArticle.Stock = 0
    Of course, you would use the names of your tables/fields.
    Have to agree that your post is a bit confusing
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    pbs is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    6
    Ok, if my post was confusing, then my apologies.(i am Dutch)
    I trie to explain it in more detail.
    i have made a database in access for all te articles i have in my store.
    there are about 2500 articles already in the database.
    I split the database in two part, and i have made different forms . 1 form for editing the database, and the other form is only form viewing the database content.
    So several people can view what is in stock.
    in the editing form i have made a button, where i can add or (plus) the amount of articles in stock, and of course also subtract.
    example: adding 10 articles. i fill in the field plus the number 10 and press the update button then it update the articles in stock with 10, and with the minus field you can subtract articles.
    example 10 pins in stock, someone is coming to my store and want 10 pins, i fill in 10 by the field minus and push the update button, so the new value is 10-10=0
    At that moment when the value is 0 then i want that the field blocked change from no to yes.
    Then if some one is searching to pins for example, they are not visible in te viewing form because in the query there is filter that shows only the non blocked.
    I know i can set it by hand but sometimes when it is busy i forget is sometimes.

    ok i hoop that this is better to understand this way.
    o ja orange what do you mean exactly with plain english (i am ducth)





















    visible

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    pbs,
    Ik ben geen Nederlander en spreek geen Nederlands. Als ik zeg, gebruik gewoon Engels, ik bedoel, gebruik geen jargon noch databasevoorwaarden. Gebruik eenvoudige termen om gebruikers te helpen uw bedrijf te begrijpen - dat is het onderwerp en wat u ermee doet. Houd het heel eenvoudig totdat we uw behoefte begrijpen. Je kunt Google translate altijd gebruiken om van het Nederlands naar het Engels te gaan, zoals ik hier heb gedaan.
    Hoeveel tafels heb je? Omdat u een knop beschrijft, lijkt het alsof u een formulier gebruikt.
    Je Engels is meer dan voldoende om op het forum te communiceren.
    Veel succes met je project.

  6. #6
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    I wouldn't hide anything relevant to an article just because there's no stock. Pretty sure there are lots of inventory type database templates or examples of their structure that you can look at. It's an involved subject that maybe doesn't fit the purpose of a forum as far as design goes. I realize you're asking a specific question, but what you've posted makes me think you're off on the wrong foot, so to speak. Aside from not hiding an article (after all, how do you get it back; how does user know why they can't see evidence of it), it seems you're storing calculations, which is often discouraged. Maybe you should post a pic of your table relationships; create it if you don't have it, just so we can see what's behind the scenes. You could also look here for inventory type models to see if anything helps.

  7. #7
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Quote Originally Posted by orange View Post
    pbs,
    Ik ben geen Nederlander en spreek geen Nederlands. Als ik zeg, gebruik gewoon Engels, ik bedoel, gebruik geen jargon noch databasevoorwaarden. Gebruik eenvoudige termen om gebruikers te helpen uw bedrijf te begrijpen - dat is het onderwerp en wat u ermee doet. Houd het heel eenvoudig totdat we uw behoefte begrijpen. Je kunt Google translate altijd gebruiken om van het Nederlands naar het Engels te gaan, zoals ik hier heb gedaan.
    Hoeveel tafels heb je? Omdat u een knop beschrijft, lijkt het alsof u een formulier gebruikt.
    Je Engels is meer dan voldoende om op het forum te communiceren.
    Veel succes met je project.
    And for the benefit of others ...

    I am not a Dutchman and do not speak Dutch. If I say, just use English, I mean, do not use jargon or database conditions. Use simple terms to help users understand your business - that's the topic and what you do with it. Keep it simple until we understand your need. You can always use Google translate to go from Dutch to English, as I have done here.How many tables do you have? Because you are describing a button, it seems like you are using a form.
    Your English is more than enough to communicate on the forum. Good luck with your project.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Replies: 3
    Last Post: 11-08-2017, 02:14 PM
  2. Table set up and replacement
    By rdhunt in forum Database Design
    Replies: 8
    Last Post: 01-11-2017, 04:30 PM
  3. Replacement for Me. in public sub
    By Stephenson in forum Access
    Replies: 2
    Last Post: 09-08-2015, 01:14 PM
  4. Any replacement for the old SetValue
    By toniartist in forum Access
    Replies: 1
    Last Post: 03-17-2012, 08:58 PM
  5. Sendkeys replacement
    By numberguy in forum Forms
    Replies: 3
    Last Post: 10-29-2010, 07:20 AM

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