Database Window

lorenzoaj

Registered User.
Local time
Today, 04:29
Joined
Nov 26, 2001
Messages
32
Hello all.

Is there a way to create a macro or write code that will unhide the database window. I have unchecked the box Display Database Window on startup so It doesn't show. What I want to do is add something to the switchboard so someone who knows what they are doing can create new queries and other stuff.

Thanks in advance.

AJ
 
AJ

The simple approach for someone to unhide the database window is to press the F11 key. This will unhide the database window.

If you search these forums there are many posts on disabling this feature.

Once this feature is disabled you can do the following:

This code is attached to the Double Click event of a lable on the switchboard called lblVersion.....

Code:
Private Sub lblVersion_DblClick(Cancel As Integer)

Dim strPasswd

    strPasswd = InputBox("Please Enter Adminisrator Password", "Restricted Form")

    If strPasswd = "[B]Insert Your Password Here[/B]" Then

          'To Unhide the Database Window
          DoCmd.SelectObject acTable, , True

        Else

        MsgBox "The Password you entered is incorrect!" & vbCrLf & _
        "Please contact your system administrator ", vbCritical, "Password Error"

        Exit Sub

    End If

End Sub

Now when the label is double clicked the user will be presented with an input box to input the password that you have specified.

The database window is opened up to show the table objects. To open this in the query objects change the line:

DoCmd.SelectObject acTable, , True to:

DoCmd.SelectObject acQuery, , True

HTH

Graham
 

Users who are viewing this thread

Back
Top Bottom