I want to use Excel VBA to query an MS Access database, searching and adding to a table.
By searching this site I found this code:
Dim dbs As DAO.Database
Dim dbs As Object
Set dbs = OpenDatabase("FILEPATH\database1.accdb")
dbs.Execute "INSERT INTO Table1(ID, Field1, Field2, Field3) VALUES('1','Hello','Helo','Hi')"
which doesn't work because it says that the sub or function was not defined for the function OpenDatabase()
Has anyone got a better method of this
The reason I want to do this when I know there are better methods out there is because the database and spreadsheet already exist (run by my employer) and I just want to link them.
dbs
. – Parfait