Results 1 to 4 of 4

Thread: Form Not Hidden

  1. #1
    Join Date
    Feb 2004
    Posts
    214

    Lightbulb Unanswered: Form Not Hidden

    I have two databases using Access 2000. Both are set to open a Main Menu form. When that form loads, the below code is suppose to open a second form but it is suppose to be hidden. This works in one database and the form is hidden but not the other, and they both have the exact same code. The one that doesn't work opens the form, but you can see the form is opened in the windows taskbar. Any reason why one is working like it should and the other is not? To make sure the code was the same, I even copied and pasted it, but same result.

    Private Sub Form_Open(Cancel As Integer)
    DoCmd.OpenForm "LogoutUsers_frm", , , , , acHidden
    End Sub

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I'm not a big fan at all of opening forms in a hidden mode (I've always found a way to do what I need to do without opening them hidden and to me, it just causes room for more problems) but I'm guessing there might be some property of the form which might be causing the problem. Especially if the code is exactly the same in both mdb's. Have you tried (making a backup first of course) just copying the form from the one that works into the non-working one?

    Again, if the code is exactly the same in both mdb's, I might focus on copying the LogoutUsers_frm or your main form itself to see if a property is set on the form which is causing the problem. My guess is perhaps the modal or some other property of the form is possibly set to true.
    Last edited by pkstormy; 11-14-07 at 18:56.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    We have a wonderful system that is LIVE at work which uses a hidden form.
    Now I inherited this mdb (I have to support it) and nobody knew the admin password for me to have an admin account created.

    So through some cunning trickery I opened the hidden form and found all the information I needed to hackify (technical term ) my way in.

    This is merely a warning to say that even if the form is hidden, it doesn't make it in-accessable
    George
    Home | Blog

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I've used the getuserandpermissions example in the code bank with some pretty good success. Although you can simply hold down the shift key to get into the mdb, it works fairly well and doesn't require user's to login or remember any passwords but determines who is logged in automatically. It uses a security table and doesn't open up any forms hidden. There's a GetUser() function which can be called anywhere in the mdb (i.e. in a form, in a query, on a report, etc.) and it will return who's logged in.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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