Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Deletions from a subform/Inactivity detection code (Access 2000/2002)

    The database I am working on is an Employee database. One section of the database will be tracking training of employees. I am using the microsoft code to detect idle time (inactivity) and users will be kicked out after 10 minutes of idle time.

    The training section of the database is the only section that will allow for deletes via subforms. For each "course" there could be multiple "classes" scheduled. If a class is scheduled but it is decided not to hold the class, the user should be able to delete the class date from the subform.

    However, I have found a strange issue, which I believe is related to the detect idle time code. When I have the detect idle time form open (in hidden mode), I can NOT delete the record from the subform...I am given the warning that the delete command can not be used at this time. When I close the detect idle time form, I can delete to my heart's content!

    (I have attached a text file with the code I am running from the subform and the code used for the detectidle form

    This is an issue I have been attempting to figure out for the past two days and just haven't been able to get any further than the fact that I believe that the detect idle time form is somehow affecting the delete command in a subform.

    Can anyone shed some light? <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

    Thanks in advance!
    Cyndy
    Attached Files Attached Files

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

    Re: Deletions from a subform/Inactivity detection code (Access 2000/2002)

    I somehow doubt that the Inactivity code is the culprit here - just a hunch on my part however. Without seeing more than the code you attached, it's pretty hard to tell however. Is the record you are trying to delete in this situation actually the currently selected record? I presume the subform is a continuous form with a button embedded in the form - I've seen cases where you have to resort to running a Delete query rather than trying to run the Delete in VBA. It may also be related to the method being used to track inactivity - there is a version preferred for 97 and earlier version and a slightly modified version for 2000 and up in <!mskb=210297>Microsoft Knowledge Base Article 210297<!/mskb>. You might also find <post#=345693>post 345693</post#> and it's attached database useful, and the thread starting with <post#=250847>post 250847</post#> explores some issues with inactivity tracking. Hope this triggers some ideas for you.
    Wendell

  3. #3
    New Lounger
    Join Date
    Oct 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deletions from a subform/Inactivity detection code (Access 2000/2002)

    Ahhh...Thanks Wendell...you were right, the inactivity code isn't the culprit, the code used to display a message telling the user that they are about to delete something from the database for good seems to be!

    Apparently the focus is being lost by displaying the message...I haven't quite figured out why, but it seems to be trying to focus on the detectidletime form...thus, the reason I thought the problem was with the inactivity code.

    I did an extraction of the form and the code to attach here, and in the process of testing it came to this realization! I am going to work on it a bit more and see if I can't come up with a solution (which may just be to get rid of the message and use access messages !) If I end up pulling out too much hair...I will post for further review!

    Thanks!

Posting Permissions

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