inneedofhelp
Registered User.
- Local time
- Today, 03:57
- Joined
- Sep 11, 2003
- Messages
- 14
At the moment i have a hardcoded link in a module to a seperate database. This works fine unless i have to travel and cannot access the server. What i would like to do is to have the code look in the current director of the database that is open and find the other database which is always the same name "Engage_Force_Master.mdb". Please help. I have attached my current code.
Public Sub LinkTables()
Dim x As Integer
For x = 0 To Application.CurrentData.AllTables.Count - 1
If Application.CurrentData.AllTables.Item(x).Name = "Engage_Force_Master" Then
Exit Sub
End If
Next
DoCmd.TransferDatabase acLink, "Microsoft Access", "\\engage force profile database\Engage_Force_Master.mdb", _
acTable, "Engage_Force_Master", "Engage_Force_Master", vbNo
End Sub
Public Sub LinkTables()
Dim x As Integer
For x = 0 To Application.CurrentData.AllTables.Count - 1
If Application.CurrentData.AllTables.Item(x).Name = "Engage_Force_Master" Then
Exit Sub
End If
Next
DoCmd.TransferDatabase acLink, "Microsoft Access", "\\engage force profile database\Engage_Force_Master.mdb", _
acTable, "Engage_Force_Master", "Engage_Force_Master", vbNo
End Sub