How to make Access visible

sumdumgai

Registered User.
Local time
Today, 15:08
Joined
Jul 19, 2007
Messages
453
From Excel, I open a database and start a macro with the following:
Set oApp = CreateObject("Access.Application")
oApp.Visible = False
oApp.OpenCurrentDatabase db, True
oApp.DoCmd.RunMacro "Import_Data"

With the macro running and Access not visible, how can I make the database visible if an error occurs in the macro? Currently, if an error occurs in the macro, a 'Msgbox' message is generated (by the database macro). But with Access not visible and Excel visible, the process cannot continue unless the user knows to click on the 'Microsoft Access' icon in the task bar to bring Access to foreground and acknowledge the 'Msgbox' message.

I'd like to activate the Access window from within the database macro.

Thanks.
 
Thanks. The Set oApp command is done in the Excel VBA macro so oApp doesn't exist in the database macro. I tried to do following but it did not work:
Set oApp = CreateObject("Access.Application") and also
Set oApp = GetObject("Access.Application")
oApp.Visible = True

I also tried following and it did not work either:
Switch_Window ("Access")
 

Users who are viewing this thread

Back
Top Bottom