Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Tables through VBA

Status
Not open for further replies.

Smithsc

MIS
Apr 20, 2007
143
GB
Hi,
Is it possible to call the 'Linked Table Manager' option through VBA code. I've got 2 linked excel spreadsheets which change location each month and I'm after an easy of changing them.

Any thoughts would be greatly appreciated..
Thanks
 
Depending on what you are doing, one of these may suit:

Code:
' > Access 2000
DoCmd.RunCommand acCmdLinkedTableManager

'Access 2000
Application.CommandBars("Menu Bar").Controls("Tools").Controls("Database Utilities"). _
    Controls("Linked Table Manager").Execute

'Access 2000
Application.CommandBars("Menu Bar").Controls("Tools").Controls("Database Utilities"). _
Controls("Linked Table Manager").accDoDefaultAction
 
Thank you all for your responses. I think I found an easier way:

Public Function OpenLTMDialog() As Boolean
On Error GoTo Error_OpenLTMDialog
DoCmd.RunCommand acCmdLinkedTableManager
OpenLTMDialog = True
Exit_OpenLTMDialog:
Exit Function
Error_OpenLTMDialog:
MsgBox Err & ": " & Err.Description
OpenLTMDialog = False
Resume Exit_OpenLTMDialog
End Function

This does what I need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top