I have code in my Excel app (2010 & 2007) that opens the app's back-end db file (.mdb). This allows me to look at tables, create temp. queries, etc. while I'm working with my Excel VBA. For some reason, if I open the file using this code, when I manually create a quick query in Access, Access forces me to save the query (only gives me SAVE or CANCEL buttons) before I close it or the DB file. I end up having all these trash queries in there I have to clean up later.
If I open the db file manually (using Access directly or MS Explorer), when I create a query I can close w/o saving it if I want.
Is there some setting I need to include in the code that opens the db file in "normal" mode so I can close w/o saving temp. queries, etc.? (Note: I am not running the Set = Nothing code at the end because I want the DB file open while I also work in Excel. Maybe that's the cause???)
'(a) Create new instance of Microsoft Access.
Set appAccess = CreateObject("Access.Application")
'(b) Open database in Microsoft Access window. (final parameter is the Password)
appAccess.OpenCurrentDatabase gMDBName, , gStdPassword
'(c) Show Acess window
appAccess.visible = True
'If this code is enabled, the Access window never appears for user.
''''Set appAccess = Nothing
If I open the db file manually (using Access directly or MS Explorer), when I create a query I can close w/o saving it if I want.
Is there some setting I need to include in the code that opens the db file in "normal" mode so I can close w/o saving temp. queries, etc.? (Note: I am not running the Set = Nothing code at the end because I want the DB file open while I also work in Excel. Maybe that's the cause???)
'(a) Create new instance of Microsoft Access.
Set appAccess = CreateObject("Access.Application")
'(b) Open database in Microsoft Access window. (final parameter is the Password)
appAccess.OpenCurrentDatabase gMDBName, , gStdPassword
'(c) Show Acess window
appAccess.visible = True
'If this code is enabled, the Access window never appears for user.
''''Set appAccess = Nothing