updating linked table

Thanks Gasman,
I cannot specify the name of the file unless I change it after the download.
The bank does not allow any interaction other than request the download.

I have eliminated the manual refreshing of the linked table (point 3 and 6).
 
Well I expect if you have eliminated 3 and 6, the process is a lot more streamlined and just a case of switching windows now?


Thanks Gasman,
I cannot specify the name of the file unless I change it after the download.
The bank does not allow any interaction other than request the download.

I have eliminated the manual refreshing of the linked table (point 3 and 6).
 
I have got this code to work before but now I can't, giving me a runtime error 3024, Could not find MyDB.accdb
Here is the code;
Code:
Private Sub cmdUpdate_Click()

Dim dbsCur As Database
Set dbsCur = OpenDatabase("MyDB.accdb")


Dim tdf As TableDef
    Set tdf = CurrentDb.TableDefs("tblCSVData")
    If Len(tdf.Connect) > 0 Then
        tdf.RefreshLink
    End If

End Sub
 
If I comment out
Code:
Dim dbsCur As Database
Set dbsCur = OpenDatabase("MyDB.accdb")


I am now getting the error I reported on post #8
 
you need to put the complete Path.
 
So I did as you suggested but still receive the same outcome
Here is the code;

Private Sub cmdUpdate_Click()
Dim dbsCur As Database
Set dbsCur = OpenDatabase("C:\Users\Gavin\MyDB.accdb")


Dim tdf As TableDef
Set tdf = CurrentDb.TableDefs("tblCSVData")
If Len(tdf.Connect) > 0 Then
tdf.RefreshLink
End If

End Sub
 
You already open the database but you did not use its instance. Which db does tblcsvdata located.
 

Users who are viewing this thread

Back
Top Bottom