updating linked table (1 Viewer)

Gavx

Registered User.
Local time
, 04:59
Joined
Mar 8, 2014
Messages
151
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).
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:59
Joined
Sep 21, 2011
Messages
14,333
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).
 

Gavx

Registered User.
Local time
, 04:59
Joined
Mar 8, 2014
Messages
151
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
 

Gavx

Registered User.
Local time
, 04:59
Joined
Mar 8, 2014
Messages
151
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
, 02:59
Joined
May 7, 2009
Messages
19,247
you need to put the complete Path.
 

Gavx

Registered User.
Local time
, 04:59
Joined
Mar 8, 2014
Messages
151
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
, 02:59
Joined
May 7, 2009
Messages
19,247
You already open the database but you did not use its instance. Which db does tblcsvdata located.
 

Users who are viewing this thread

Top Bottom