Tip to SHOW Database Window?

  • Thread starter Thread starter D. Shane Fowlkes
  • Start date Start date
D

D. Shane Fowlkes

I have a Form automatically loaded when my Access 2003 db opens and the
Database Window is "hidden". I know pressing F11 will show the database but
I'm trying to create a user-friendly button where the user can just click
the button and see the window. I can't seem how to do this using a macro or
code. I tried using a SendKeys macro but that seems not to work with
Function keys.

Any pointers?

Thanks
 
Use docmd.Selectobject and select any object of any type, be sure to set the
InDatabaseWindow parameter to true:

Private Sub Command7_Click()
DoCmd.SelectObject acForm, "Form9", True
End Sub
 
Thanks! But how would I select the Database Window itself using DoCmd.
It's not a form or table or query....etc.

Thanks again


Sandra Daigle said:
Use docmd.Selectobject and select any object of any type, be sure to set the
InDatabaseWindow parameter to true:

Private Sub Command7_Click()
DoCmd.SelectObject acForm, "Form9", True
End Sub


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


D. Shane Fowlkes said:
I have a Form automatically loaded when my Access 2003 db opens and
the Database Window is "hidden". I know pressing F11 will show the
database but I'm trying to create a user-friendly button where the
user can just click the button and see the window. I can't seem how
to do this using a macro or code. I tried using a SendKeys macro but
that seems not to work with Function keys.

Any pointers?

Thanks
 
AFAIK you can't - you have to name some object - any object will do but you
need to specify an object.

You could also use the following but it pops up a dialog which is probably
not desirable:

DoCmd.RunCommand acCmdWindowUnhide

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


D. Shane Fowlkes said:
Thanks! But how would I select the Database Window itself using
DoCmd. It's not a form or table or query....etc.

Thanks again


Sandra Daigle said:
Use docmd.Selectobject and select any object of any type, be sure to
set the InDatabaseWindow parameter to true:

Private Sub Command7_Click()
DoCmd.SelectObject acForm, "Form9", True
End Sub


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


D. Shane Fowlkes said:
I have a Form automatically loaded when my Access 2003 db opens and
the Database Window is "hidden". I know pressing F11 will show the
database but I'm trying to create a user-friendly button where the
user can just click the button and see the window. I can't seem how
to do this using a macro or code. I tried using a SendKeys macro
but that seems not to work with Function keys.

Any pointers?

Thanks
 
Hmmm...that's surprising. OK...thanks.



Sandra Daigle said:
AFAIK you can't - you have to name some object - any object will do but you
need to specify an object.

You could also use the following but it pops up a dialog which is probably
not desirable:

DoCmd.RunCommand acCmdWindowUnhide

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


D. Shane Fowlkes said:
Thanks! But how would I select the Database Window itself using
DoCmd. It's not a form or table or query....etc.

Thanks again


Sandra Daigle said:
Use docmd.Selectobject and select any object of any type, be sure to
set the InDatabaseWindow parameter to true:

Private Sub Command7_Click()
DoCmd.SelectObject acForm, "Form9", True
End Sub


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


D. Shane Fowlkes wrote:
I have a Form automatically loaded when my Access 2003 db opens and
the Database Window is "hidden". I know pressing F11 will show the
database but I'm trying to create a user-friendly button where the
user can just click the button and see the window. I can't seem how
to do this using a macro or code. I tried using a SendKeys macro
but that seems not to work with Function keys.

Any pointers?

Thanks
 
Hi Sandra

Actually, you can use the empty String for name or leave the name argument
blank.

I tested in A2K2 with both:

DoCmd.SelectObject acTable, "", True

and

DoCmd.SelectObject acTable, , True

and both work fine showing the Table Container of the Database window.
 
I thought there might be a way but didn't try it with the empty string. I
had tried leaving out the object name parameter but got an error. Tried both
again just now and bingo, it works.

Hmmm, I wonder what my error was earlier . . . oh well. Thanks for jumping
in Van!
 
Great. Thanks everyone.

--

**************************


Sandra Daigle said:
I thought there might be a way but didn't try it with the empty string. I
had tried leaving out the object name parameter but got an error. Tried both
again just now and bingo, it works.

Hmmm, I wonder what my error was earlier . . . oh well. Thanks for jumping
in Van!

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

Hi Sandra

Actually, you can use the empty String for name or leave the name
argument blank.

I tested in A2K2 with both:

DoCmd.SelectObject acTable, "", True

and

DoCmd.SelectObject acTable, , True

and both work fine showing the Table Container of the Database window.
 
Back
Top