Iain has attended:
Access VBA course
Command to move to the Table objects window
Hi!
I've got a button on a form to close the form and I'd like to make it move to the Tables window when I click on it.
I tried...
DoCmd.GoToControl (Tables)
and
Dim db As Database
Set db = CurrentDb()
db.objects.Tables.SetFocus
...but neither worked.
Any ideas?
Thanks
RE: Command to move to the Table objects window
Hi Iain
I have looked at this and consulted with some collegues and the general opinion is you cannot use code to go to a specific view of the database.
This may be due to to the fact that in most Access databases the tables are hiden from the user.
Sorry if I couldn't help more
Carlos
RE: Command to move to the Table objects window
Carlos
I found the code that can do this in the Northwind db, so thought I'd post it in case its of use.
Private Sub cmdGoToTablesWindow_Click()
DoCmd.Close
DoCmd.SelectObject acTable, "Core", True
End Sub
...where "Core" is the name of one of your tables. I presume it will work for forms, reports etc.
Iain