Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    Belfast, Ireland
    Posts
    339
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Automatic 'unchecking'??? (2003 SP1)

    Our database has an 'Active' checkbox that users uncheck in order to 'remove' people from the Database. This box has a msgbox that advises them that unchecking this box will remove the person from the Database.

    Recently, a couple of people have 'disappeared' from the Database. At first, we thought that someone had either accidentally unchecked the Active box or had genuinely removed the person believing them to be gone from the company. As such, we created a Second Message Box warning people to heed the following Dialog Box (hoping that this would prevent people accidentally dismissing the msgbox and continuing on with the removal of a person). However, this has not helped, and we have seen a couple of people 'removed' from the Database up to 5 times. These people have absolutely not left the company for which they work, so either someone really has it in for this person and is determined to take them off the Database (despite the fact that they absolutely still work for the company) or this Record is corrupt or something . . .

    Is it possible that this IS a corrupt record and that the checkbox is resetting itself from True to False all by itself? Or is it a definite that someone is simply determined to take these people off the Database?

    Thanks in advance for your insights. [img]/forums/images/smilies/smile.gif[/img]

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatic 'unchecking'??? (2003 SP1)

    Do the records really get deleted, or is the Active check box bound to a Yes/No field in the table?

    If a record becomes corrupt, it seldom just disappears. Usually, you'll get an error message when you try to view it. And check boxes seldom reset themselves spontaneously.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    Belfast, Ireland
    Posts
    339
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Automatic 'unchecking'??? (2003 SP1)

    Hi Hans

    No, the Records (fortunately) do not get deleted. The underlying query simply displays staff who work for the Company/Branch based on whether this checkbox is set to True or False, ie, if Active=True, then they get included in the Query/Form. If Active=False, logically they are not selected and displayed: this give the illusion that they have been removed from the Database. However, we can simply go into the underlying Table and change the checkbox back to True, and the person then 'reappears' on the Database.

    "And check boxes seldom reset themselves spontaneously."

    So, it's possible that this could be happening? Is it possible that it keeps happening to the same people?

    As always, thanks for your replies. [img]/forums/images/smilies/smile.gif[/img]

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatic 'unchecking'??? (2003 SP1)

    I think it's improbable that this occurs spontaneously, in other words, it seems more likely that someone actually clicks the check box. But of course, I cannot be certain. I would do the following, of you haven't done so already:
    - Add two fields to the table: LastModified (Date/Time) and ModifiedBy (Text, length 40 or so)
    - In the Before Update event of the form, add code to set those fields:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    ' other code you need goes here
    ...
    Me.LastModified = Now
    Me.ModifiedBy = GetNetUser
    End Sub

    - See <post#=446010>post 446010</post#> for the GetNetUser function, it belongs in a standard module.

    This will enable you to see who actually modifies a record. If someone clears the Active check box, it's unlikely that the record will be edited by someone else after that, because it's not displayed in the form any more, so the ModifiedBy field should tell you who does this - if it is done by a user.

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Automatic 'unchecking'??? (2003 SP1)

    Note that if users can get into the back-end of the database, or if they can unhide the database window and open the table, then it would be possible for them to also un-check the check-box in the table. Hans' suggestion works fine as long as users are not allowed to edit at the table level.
    Wendell

  6. #6
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    Belfast, Ireland
    Posts
    339
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Automatic 'unchecking'??? (2003 SP1)

    Thanks for your replies.

    I added the post 446010 Code to a Module called GetNetUser
    I then Added the Code (Me.LastModified = Now, Me.ModifiedBy = GetNetUser) to the BeforeUpdate Event

    However, when I try to make a change, I get a Dialog that says 'Compile error: Expected variable or procedure, not module'.

    Have I misunderstood your posts?

    Thanks again for your help. [img]/forums/images/smilies/smile.gif[/img]

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatic 'unchecking'??? (2003 SP1)

    You have given the module the same name as the function GetNetUser. This confuses VBA. To solve this, give the module another name.

  8. #8
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    Belfast, Ireland
    Posts
    339
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Automatic 'unchecking'??? (2003 SP1)

    <img src=/S/doh.gif border=0 alt=doh width=15 height=15>

    You're a star.

    Thanks. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  9. #9
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    Belfast, Ireland
    Posts
    339
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Automatic 'unchecking'??? (2003 SP1)

    Just wanted to say 'Thanks Again'. I've implemented this now, and it works a treat!

    Users beware. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    You really are . . . <img src=/S/clever.gif border=0 alt=clever width=15 height=15>

Posting Permissions

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