i'm wondering there way add macro afterupdate table event in vba?
dim db database, tdef tabledef set db = currentdb set tdef = db.createtabledef("arch_call") tdef.connect = buildlinkstring(username) tdef.sourcetablename = createdatasourcestring(builddatasourcestring, "linkedtablename") db.tabledefs.append tdef
i re-create linked table after each login, need re-associate afterupdate table event well.
docmd.runmacro "macroname"
should trick. tack on @ end of afterupdate event.
edit:
why not change link instead of creating new table? don't have reassign macro using vba.
set db = currentdb set tdf = db.tabledefs("arch_call") tdf.connect = "odbc;driver=sql server;server=10.0.0.1;" _ & "uid=testdb;app=microsoft office 2003;wsid=abc;table=dbo.arch_call" tdf.refreshlink
Comments
Post a Comment