GoingCrazy
Technical User
I am interested in automating my Make Table and Update queries since I have to update a number of tables on a daily basis. I have two tables I am working with...Table1 and Table2. I need to copy the information from Table1 to Table2 and then delete Table1 so I can "Make" Table1 with the new information. There is information in Table2 that then needs to be updated in Table1. I've tried the following Macro:
CopyObject 'Table1 to Table2
DeleteObject 'Table1
OpenQuery 'Make Table query
OpenQuery 'Update Table query
I've tried to keep it simple, but the only part that seems to work is the Update portion of the query. The Table1 info is not updated with the new information. I've tried using a DeleteObject for Table2 and then renaming Table1 to Table2, but that ends up deleting Table2 after it updates Table1. Because of this the macro works only once because it can't find Table2 the next time it's run. By the way, I can run each query separately and they all work great. I was just hoping to combine them into a macro to automate the process.
If anybody can help, I would greatly appreciate it. I am not proficient in VB so I don't know how to do this in a module. I am open to anything that may resolve this problem, but please provide whatever steps you can and the location for the code.
Thanks for your assistance.
CopyObject 'Table1 to Table2
DeleteObject 'Table1
OpenQuery 'Make Table query
OpenQuery 'Update Table query
I've tried to keep it simple, but the only part that seems to work is the Update portion of the query. The Table1 info is not updated with the new information. I've tried using a DeleteObject for Table2 and then renaming Table1 to Table2, but that ends up deleting Table2 after it updates Table1. Because of this the macro works only once because it can't find Table2 the next time it's run. By the way, I can run each query separately and they all work great. I was just hoping to combine them into a macro to automate the process.
If anybody can help, I would greatly appreciate it. I am not proficient in VB so I don't know how to do this in a module. I am open to anything that may resolve this problem, but please provide whatever steps you can and the location for the code.
Thanks for your assistance.