Tip to SHOW Database Window?

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
 
S

Sandra Daigle

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
 
D

D. Shane Fowlkes

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
 
S

Sandra Daigle

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
 
D

D. Shane Fowlkes

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
 
V

Van T. Dinh

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.
 
S

Sandra Daigle

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!
 
D

D. Shane Fowlkes

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top