|
-
Mar 10th, 2004, 02:04 PM
#1
Thread Starter
Fanatic Member
Macro Access 2000 - eplace table with new data
I have two tables. Table1 and Table2
How can I create a macro that will take the data in Table2 and replace the data in Table where the LastName is the same....?
-
Mar 11th, 2004, 04:42 AM
#2
Addicted Member
can be acheived with an UPDATE SQL statment. (Access)
Code:
Dim dbs as Database
set dbs = CurrentDB
dbs.Execute "UPDATE Table2 " _
& " INNER JOIN Table1 ON Table2.[Last Name] = Table1.[Last Name] " _
& " SET Table1.[FieldName] = Table2.[FieldName];"
or create the query that carries out your update in access and call it from code
Code:
DoCmd.OpenQuery "QueryName", acViewNormal
Not tested but HTH
Brian
Last edited by Br1an_g; Mar 11th, 2004 at 05:06 AM.
if you fail to plan, you plan to fail
-
Mar 14th, 2004, 03:20 PM
#3
hey, just out of pure interest, what's HTH mean??!?!?
-
Mar 15th, 2004, 06:27 AM
#4
Addicted Member
Hope This helps
if you fail to plan, you plan to fail
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|