Hendra-
Try this:
Dim Db As DAO.Database, tdf As DAO.TableDef
Dim sLinkAddress As String
sLinkAddress = "D:\HDK_DB\AG_BE.mdb"
Set Db = CurrentDb
Set tdf = db.Tabledefs("T_1_PEG")
tdf.Connect = ";Database=" & sLinkAddress
tdf.RefreshLink
MsgBox "Refreshed"
Of course, that won't work either if your table isn't actually a linked table.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
On Mar 7, 2014, at 6:21 PM, Agestha Hendra <agesthahendra@ymail.com> wrote:
> Hi All... :)
>
> I want to refresh a linked table, i tried this code :
>
> '----------------------------------------------------------
> Dim Db As Database
> Dim sLinkAddress As String
>
> sLinkAddress = "D:\HDK_DB\AG_BE.mdb"
> Set Db = CurrentDb
>
> Db.TableDefs("T_1_PEG").Connect = ";Database=" & sLinkAddress
> Db.TableDefs("T_1_PEG").RefreshLink
>
> MsgBox "Refreshed"
> '----------------------------------------------------------
>
> but got an erorr :
>
> Invalid Operation, and "Db.TableDefs("T_1_PEG").Connect = ";Database=" & sLinkAddress" was highlited
>
> Please give me directions to solve this,,,it would be appreciated,, thank you.
>
> Regards
> Hendra Agestha
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
>
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar