Open DB from Excel - forced to save query, etc

PaulZak

Board Regular
Joined
Aug 22, 2006
Messages
105
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
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,215,360
Messages
6,124,491
Members
449,166
Latest member
hokjock

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top