Refresh Navigation pane “Tables” (1 Viewer)

AccessVBANewbie

Registered User.
Local time
Today, 03:59
Joined
Jan 23, 2014
Messages
19
Hi
After I add a table or delete a table is Ado.
How do I refresh Navigation pane “Tables” with code.

Thank you
 

Freshman

Registered User.
Local time
Today, 05:59
Joined
May 21, 2010
Messages
437
Maybe start by posting the code you using to add the table
 

AccessVBANewbie

Registered User.
Local time
Today, 03:59
Joined
Jan 23, 2014
Messages
19
qry_test = "CREATE TABLE Test" & "(" & _
" Field1 TEXT(20) null, " & _
Set rs = cnnDB.Execute(qry_test)
‘Here the refresh should go to force a Navigation Pane refresh
 

AccessVBANewbie

Registered User.
Local time
Today, 03:59
Joined
Jan 23, 2014
Messages
19
Hi
CurrentDb.TableDefs.Refresh
Above does not force navigation pane to refresh, still takes 5-10 seconds to do it itself.

Thanks
 

Freshman

Registered User.
Local time
Today, 05:59
Joined
May 21, 2010
Messages
437
I think it is quite normal for Access to take a while for you to see the table. Sometimes you have to click on another object say Queries and then back on Tables to refresh but I don't think it means the table does not exist yet.
So refreshing the database window is a fine trick allowing you to see the table appear. But as I said the table is probably already there you just don't see it.

Here is a function to test for the table (even if you don't see it)

Public Function TableExists(Name As String) As Boolean
TableExists = DCount("*", "MSysObjects", "Name = '" & Name & "' AND Type = 1")
End Function


Which means you can already relate to the table even if you cannot see it.
 

Users who are viewing this thread

Top Bottom