Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2008
    Posts
    49

    Unanswered: Menu's and tool bars Disappeared

    hi i need help with my database in access.

    I created an Splash screen which was a login form which allowed users to log in into the database. I hidden all the menus by going to tools - startup and then unchecking all the options. now the database opens but all menus are disabled. the tools menu at the top is not there so i cant even tick those options agin to get it back to normal.

    any help please

    thanks

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I'm going from memory here but...

    Hold the shift key down while opening the mdb and right-click on the bar at the top and select to show the missing toolbars/menus (I think you'd check the File toolbar to see the Tools option again) and then/or Click Tools -> Customize and check the appropriate toolbars/menus (and look at the properties of the toolbar to see what they are - i.e. Allow Hiding, Allow Customizing, etc...)
    Last edited by pkstormy; 03-18-08 at 14:58.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Feb 2008
    Posts
    49
    thank you, it worked. Ive got a start up form which is a log in form. the user selects the user name and enter's the password. The username and password is stored in a table in the database. the code compares the password entered in the text box with the one stored in the table and grants access. once access is granted the switchboard opens.

    this is all good but the only problem is that even if no password or username is entered the user can still access the menu on the right and open, edit , del tables, forms etc. so the log in provides no security.

  4. #4
    Join Date
    Feb 2008
    Posts
    49

    screenshot

    here is the attachment of the screen shot and code
    Attached Files Attached Files

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I'm not a big fan of the user having to enter their username and a password (see this example which I prefer: http://www.dbforums.com/showpost.php...&postcount=20). - It automatically get's the user loginID as well as their permissions in a "permission/admin" type of table. You'll also notice in the example (using a form called MainformBackground) that the user cannot click on the menus (even though they are there.) This is controlled by using "modal" popup forms throughout the mdb (and the MainformBackground which is the form loading on startup) which I often do. Notice in the example I also have an "Admin Close" button which then lets me easily close the form and still see the menus. I do this as making the menus invisible was a pain then to always make them visible for designing.

    There is also an example in the code bank called Form Manipulation which lets you manipulate the form in different ways if you need to which you may want to take a gander at.

    And lastly, I think there is post somewhere in one of these Access posts a few months back a vba command way to not show the menus.

    Sorry I can't help you on the menu - search for the post though and the command to make the menus invisible. I just really don't like the user having to enter this info and prefer the method I use in the example.
    Last edited by pkstormy; 03-18-08 at 15:38.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Feb 2008
    Posts
    49
    hi thanks for the example, i need a log in form as there is only 2 users of the database. each user has a username and password and both have admin permissions. no other user should be able to login.

    im going to have a look and try to find that code if anyone has a link to the thread please let me now

    thanks

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You can still have your login form and prevent the users from getting to the menu utilizing the MainformBackground as in the example.

    Here's the code I found in my snippets (can't recall who originally posted it on this site though as I had this in my snippets):

    Dim cbar As Object

    ' /// kill the menus (will error so need the resume next)
    On Error Resume Next
    For Each cbar In Application.CommandBars
    cbar.Visible = False
    Next
    Set cbar = Nothing

    ' /// standard error handling
    On Error GoTo err_Form_Load

    But you'll probably still have the problem of showing the menu when you get into the mdb for designing (I can't say for sure as I haven't actually used the code above.)
    Last edited by pkstormy; 03-18-08 at 17:31.
    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
  •