Results 1 to 9 of 9
  1. #1
    cbuechner is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2021
    Posts
    60

    Popup warning

    Im still researching, and hopefully I can be put on the right path.

    I have a table, that the user enters a piece of equipment. I also have a query that counts the number of times the equipment is used. What I would like to do is if the value on that specific equipment reaches 2, then a popup warning will display, saying that is it time for servicing the equipment. I plan on putting this on a form, for when the user would enter the equipment.

    I just need a good place to start on researching this problem.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Not much info.
    What kind of form, single record view, datasheet, main or subform, continuous form?
    2 is the number of times used?
    Equipment is "entered on the form" how? Can it be that when I see the equipment on the form and navigate away from that record (assuming that's possible) can the value suddenly become 2? Then the right event is the form Current event. Or is the user doing something on that record and as a result, the value is updated and might become 2? Then the form After Update event. Or if the calculation is needed before the record is saved, then the form Before Update event.

    There's SO much you haven't revealed!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    depends on how the value on that specific equipment reaches 2. is it calculated? if so what is the code? or is it entered by the user?

    @Micron - sn
    ap


  4. #4
    cbuechner is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2021
    Posts
    60
    OK, I will give more details.

    The form is Load_Machine, and on this form, there is three fields that the user enters the injector serial numbers into three fields (injector1, injector2, injector3), and then I have a union query that lumps them all as Injectors. I then run another query that counts the occurrences for each injector (from the union query), and also counts the number of times the injector was serviced (injector table). It calculates the number of times that particular injector ran and minuses the number of times it has been serviced. In effect, once it is serviced, it rests the number back to 0. Either way, Once this final number reaches 2 (meaning it has ran twice), then it alerts the user that it is due to be serviced. Once it it is serviced, the user indicates this, and that number goes back to 0.

    If not an alert, maybe an email. I am just starting to look into this...

    Here is how it is calculated One/Two/Three is service intervals. Meaning if it is serviced once, it is 1, and 2 and so on.

    Current_Count: [CountOfInjector]-[One]-[Two]-[Three]

    Thank you for any help on this problem.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    So once the user enters all 3 serials you want something to happen? I think you will have to drive the running of the queries from that form and return the result to the form when all 3 values have been entered. That way, the form code can present a message box or send an email, whichever it is that you decide on. I get the impression though that this is 3 separate calculations because there are 3 different serials being entered.

    FWIW, your approach is making this a bit more complicated than it needs to be. I can't provide specifics not knowing how things look, but if you have to enter 3 control values then join them in a list (Union query) just so you can count occurrences, the data isn't being stored correctly. Perhaps that is because it's the way you get if from some other system and you're stuck with it. At this point I think the answer is that you cannot do this sort of thing with queries themselves; you'll need code.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Is this a situation where someone is logging out a piece of equipment and then logging it in when it is returned?
    Rather than a numbering system you would use the dates for your calculations and use the logging back in for your triggering event.
    This can be calculated on the fly without having to update or reset numbers back to 0.
    First you would get the last service date for the injector from a service table and then count the number of dates the injector was logged as retuned since that service date.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  7. #7
    cbuechner is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2021
    Posts
    60
    I am almost say for sure this isnt the best this can be built. The reason I created it this way is because some of it was already built, and im trying to just add more, without changing what we already have
    in the database. I am starting to look more into how to develop a database in a more normalized way.

    I appreciate the feedback.

  8. #8
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    It's best to normalize now before adding more features or you will find yourself banging your head against the wall trying to come up with workarounds.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  9. #9
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    agree with other comments - normalise your data - you need to balance 'ease of input' to 'ease of output'

    and where does [countofinjector] come from? and you calcualation makes no sense if you have used a union query

    if the requirement is 'reaches 2' then you calc could be along the lines 'if this injector used since last service then send a message'

    Also what is the need to send an instant (and multiple) messages?

    why not at the end of the day send one message saying something like 'the following injectors need servicing' and provide a list

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

Similar Threads

  1. Popup not popup properly
    By perryc in forum Access
    Replies: 3
    Last Post: 04-19-2019, 05:47 AM
  2. Why the warning?
    By MdHaziq in forum Access
    Replies: 10
    Last Post: 10-05-2017, 08:05 PM
  3. set warning off
    By bet in forum Programming
    Replies: 2
    Last Post: 03-27-2011, 04:21 PM
  4. Warning messages
    By Bobcoop103 in forum Access
    Replies: 3
    Last Post: 08-12-2010, 11:45 PM
  5. Security Warning
    By mojo53777 in forum Security
    Replies: 0
    Last Post: 11-16-2007, 06:23 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