Displaying the "Database" window

  • Thread starter Thread starter Jake
  • Start date Start date
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
 
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
 
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.
 
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
 
Or maybe:

Sub DisplayDbWindow(Optional Setting as boolean = true)

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

End Sub
 
Back
Top