Hi everyone,
I have a form and want one of the combo box's to run a VBA code that does the following:
Opens up 2 databases and appends an excel file to each and then runs a query that is in each of those databases.
E.G.
On click:
Dim appAccess As New Access.Application
Dim FilePath As String
Dim BackEndDB As String
Set appAccess = Access.Application
FilePath = "Jatabases"
BackEndDB = "DB1.accdb"
appAccess.OpenCurrentDatabase FilePath & BackEndDB
'Insert code here to append excel file "DB1Excel.xlsx" from Jatabases\
DoCmd.OpenQuery "DeleteDupesDB1"
I know there's something wrong because it's saying that the database is already open. I have a table from all of these databases linked to my current DB I'm working in (my front end).
Please let me know if there's a way to open and run the back end database and append the excel sheet. I'm really struggling here :/
Thanks!
I have a form and want one of the combo box's to run a VBA code that does the following:
Opens up 2 databases and appends an excel file to each and then runs a query that is in each of those databases.
E.G.
On click:
Dim appAccess As New Access.Application
Dim FilePath As String
Dim BackEndDB As String
Set appAccess = Access.Application
FilePath = "Jatabases"
BackEndDB = "DB1.accdb"
appAccess.OpenCurrentDatabase FilePath & BackEndDB
'Insert code here to append excel file "DB1Excel.xlsx" from Jatabases\
DoCmd.OpenQuery "DeleteDupesDB1"
I know there's something wrong because it's saying that the database is already open. I have a table from all of these databases linked to my current DB I'm working in (my front end).
Please let me know if there's a way to open and run the back end database and append the excel sheet. I'm really struggling here :/
Thanks!