Why is my code not working. Any help would be apprecated.
Thank You,
rjoshi2
My code:
Private Sub Form_Load()
Dim strDB2 As String
Dim strTbl2 As String
'To Hide the Database Window
DoCmd.RunCommand acCmdWindowHide
myCommandBar 'create a commandbay
'strDB2 = "PSC IT Acquisition Data File"
strDB2 = "\\Psc2\Data\Ocio\SHARED\Acquisitions\Back end of PSC IT Acquisition Log\PSC IT Acquisition Data File.mdb"
strTbl2 = "Core Data Dump"
fctnRelink(strdb2, strtbl2)
End Sub
Function fctnRelink(strDB As String, strTbl As String)
DBEngine(0)(0).Execute "DROP TABLE [" & strTbl & "];"
DoCmd.TransferDatabase acLink, "Microsoft Access", strDB, acTable, strTbl, strTbl
End Function
Thank You,
rjoshi2
My code:
Private Sub Form_Load()
Dim strDB2 As String
Dim strTbl2 As String
'To Hide the Database Window
DoCmd.RunCommand acCmdWindowHide
myCommandBar 'create a commandbay
'strDB2 = "PSC IT Acquisition Data File"
strDB2 = "\\Psc2\Data\Ocio\SHARED\Acquisitions\Back end of PSC IT Acquisition Log\PSC IT Acquisition Data File.mdb"
strTbl2 = "Core Data Dump"
fctnRelink(strdb2, strtbl2)
End Sub
Function fctnRelink(strDB As String, strTbl As String)
DBEngine(0)(0).Execute "DROP TABLE [" & strTbl & "];"
DoCmd.TransferDatabase acLink, "Microsoft Access", strDB, acTable, strTbl, strTbl
End Function