Share via

Running a macro from another database

Anonymous
2018-07-05T14:43:21+00:00

I have a database that I run TransferDatabase export from. I have a problem with the size of the 2nd database, so I delete all the tables in that one before running the transfer from the main one. 

Is there a way I can run the macro I have set up, to do the deletes in the 2nd database from the 1st before it starts to do the data transfers?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2018-07-05T18:13:12+00:00

Why not use the function on that page?  Much simpler than starting from scratch, no?

If you want to use Shell, then follow the setup in the functions on that page.

Call Shell("msaccess.exe D:\Objects\ALE\ETO_46.accdb /x YourMacroName", 3)

Also, deleting the tables will not regain any space, you'll need to perform a compact prior to your import.

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2018-07-05T18:04:48+00:00

    I tried running the code from the link but I keep getting an "Invalid procedure call or argument".

    Here is how I have it written.

        Dim delTables

        delTables = Shell("D:\Objects\ALE\ETO_46.accdb", vbMaximizedFocus)

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2018-07-05T14:51:11+00:00

    Was this answer helpful?

    0 comments No comments