Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005

    Question Unanswered: Do Not Allow If...

    I volunteered for a project and have gotten myself in over my head.

    We have a DB that is used to issue equipment on a temporary basis. (keys, radios, etc.)

    Each item has a unique identifier for a specific field in the table.

    What we'd like to do is ensure that the same item is not issued to two different people unless it is turned in.

    For example, tbl_keys has the fields "radio" and "intime".

    If "radio" has r30 in it (radio 30 has been issued), but "intime" is blank (it has not been turned in) I would like a message to pop up stating that the equipment is already signed out if someone tries to issue r30 again.

    How can I accomplish this?


  2. #2
    Join Date
    Jan 2005
    Assuming that you have a form bound to tbl_keys and you have a combo box bound to the radio field and another control (txtIntime) bound to the InTime field, you could try the following. Place this code in the OnChange event of your radio combo box:

    If IsNull(Me.txtIntime) then
    -- your message box code here --
    End If

    Of course, there are probably several other methods by which to accomplish this same task. I'm sure that many of the forum members will toss suggestions your way and some of those suggestions will be far superior to mine. There are a few things that you will want to keep in mind though:

    1. Even though you're hitting the end user with a message box, you still need a method to keep them from reissuing a piece of equipment. I'd suggest disabling any subsequent controls (including any Save options) until they select a piece of equipment that has been returned.

    2. When a piece of equipment has been returned, you'll want to write the return time to your table. In my opinion, this is a bit excessive as a simple True/False or Yes/No field would do the trick nicely. I don't see the significance of the time unless you're tracking the item for reporting purposes. This would make for a more complicated structure and is a bit redundant unless you're tracking the items for reporting purposes.

    3. When an item is "checked out", you'll have to clear the InTime field or (as in my suggestion above) set the corresponding True/False field to the "False" position. If you're going the reporting route, to check the movement of a particular item, I would go with a slightly different structure.

    Just some ideas. Love them, hate them, or ignore them - the choice is yours. HTH.
    "Simplicity is the ultimate sophistication"

  3. #3
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    create another table to track your inventory. Stamp it with time in and time out. Search for an item within that table that doesn't have a time in and you'll know it's still checked out.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Sep 2005
    Teddy, I really didn't understand that.

    DaVinci, your idea worked to a certain extent. It applies to any radio issued though. I applied it as you suggested and the message box pops up when any radio is being issued rather than the specific one that is still out.

    So, how to I make it more so that it targets the specific piece of equipment?

    I've attached it for someone to look at. Feel free to copy/use and/or line your bird cage with it.

    Attached Files Attached Files
    Last edited by davenportjacque; 10-03-05 at 18:06.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts