Database Window

law

Registered User.
Local time
Today, 13:18
Joined
Feb 14, 2004
Messages
26
Can anybody help with a problem that I am currenlty having with Access 2000. I currently have a form & on this form I have a command button which when you click I would like it to display the database window. I have tried to do it in code & cant if anyone knows the code to allow me to view the database window when I click the button (which is on the form) I would be very greatful?

Thanks!
 
F11 and/or Alt+F1 causes the database window to open.

One solution is to use the event Sendkeys, on your button ONClick event, e.g.

SendKeys "{F11}"
 
'The below code will disable (hide) all menu bars and tool bars.
'Ensure that you have a way to enable (unhide) the menu bars
'and tool bars (transparent command button) before you hide them!

'this will disable all menu bars and tool bars
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i

'this will enable all menu bars and tool bars
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = True
Next i

'An added bonus is the right click option is disabled if the menu bars are disabled with the above code.

'Use the 'ShowToolbar' command if you need to display a tool bar or menu bar...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarYes

'This will hide a tool bar or menu bar when needed...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarNo

'This will hide the Menu Bar...
DoCmd.ShowToolbar "Menu Bar", acToolbarNo

'You can also hide/unhide the database window with code...

'Hide the database window
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide

'Unhide the database window
DoCmd.SelectObject acTable, , True

'Visit this link to see how I disable the Shift key [from within the db] using VBA...
Disable the AllowBypassKey property

Or visit this link for more tricks...
Hide all Access Toolbars and Menubars

'HTH
 
Last edited:
I have now got the vb code below, to display the database window but it still isnt working. And I HAVE A COMMAND button to click as you can see below to open the window so it pressing F11 is no good. I am getting an error when I click the command button?


Private Sub cmdDisplayDatabaseWindow_Click()
DoCmd.SelectObject acTable, , True
End Sub
 

Users who are viewing this thread

Back
Top Bottom