Displaying the "Database" window

J

Jake

Is there a way to display the stanadard database window programatically?

It doesn't normally open if there is a startup form set up, but I would like
to be able to display it under certain circomstances.

Thanks
Jacob
 
M

Marshall Barton

Jake said:
Is there a way to display the stanadard database window programatically?

It doesn't normally open if there is a startup form set up, but I would like
to be able to display it under certain circomstances.


Sub ShowDbWindow()
DoCmd.SelectObject acTable, , True
End Sub

Sub HideDbWindow()
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide
End Sub
 
D

Dale Fye

Jake, try the following:

DoCmd.SelectObject acTable, strTableName, true

Set the value of strTableName to the name of a table that you know is in the
database, and is not hidden. Or, if you want to add some error checking, you
can pass it any value and trap for err.number = 2544, which is the error
message that will display if Access is unable to find the table with the name
you pass it.
 
D

Dale Fye

Absolutely.

Thanks for the info.

Chris O'C via AccessMonster.com said:
Dale, the 2nd argument isn't required if the 3rd argument is true. The db
window will appear showing the tab for the object type. You can avoid
finding an appropriate table name and adding any error handling. Easier,
don't you think?

DoCmd.SelectObject acTable, , true

Chris
 
D

Dale Fye

Or maybe:

Sub DisplayDbWindow(Optional Setting as boolean = true)

DoCmd.SelectObject acTable, , True
if Setting = False then DoCmd.RunCommand acCmdWindowHide

End Sub
 

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