I am trying to open an access database from another database and run a macro in it. I can accomplish this, but I also need to pass variables into the other database's macro for it to run appropriatly.
DB 1: user makes selection on user form and they are stored as variables - macro opens DB2 and calls macro "main"
sub main(variable1, variable 2, variable3, etc..)
I cannot figure out the syntax of how to pass variables when trying to run the macro in the second DB. Is this possible. My code is below:
Dim accapp As Access.Application
Set accapp = New Access.Application
accapp.OpenCurrentDatabase ("C:\Users\123\Desktop\models\RPA V3.accdb"), False
accapp.Visible = True
accapp.Run "main" '------ this is where I need to pass variables into sub routine 'main'
DB 1: user makes selection on user form and they are stored as variables - macro opens DB2 and calls macro "main"
sub main(variable1, variable 2, variable3, etc..)
I cannot figure out the syntax of how to pass variables when trying to run the macro in the second DB. Is this possible. My code is below:
Dim accapp As Access.Application
Set accapp = New Access.Application
accapp.OpenCurrentDatabase ("C:\Users\123\Desktop\models\RPA V3.accdb"), False
accapp.Visible = True
accapp.Run "main" '------ this is where I need to pass variables into sub routine 'main'