problem afrer calling sub in another DB


J

Jim Burke in Novi

I sometimes need to execute a subroutine that is in another Access database.
This works great. However, after I shut down my application, the next time I
start it the window is not maximized, even though I know a Maximize is being
done (I checked this). This only happens when this 'remote' sub is called.
Otherwise the application always starts maximized. Here is the code I have
for executing the sub in the other database:

Dim acc As Access.Application

Set acc = New Access.Application
acc.OpenCurrentDatabase DBName
acc.Echo False
acc.Modules("GlobalVars").Application.Run "UpdateStatsForOfficeAppl"
acc.DoCmd.Maximize
acc.CloseCurrentDatabase
Set acc = Nothing
Exit Function

I added 'acc.DoCmd.Maximize' thinking that maybe that would do it, but no
dice. Any idea what I can do to make sure that the application starts up
maximized on the next startup? Any help is appreciated!
 
Ad

Advertisements

J

Jim Burke in Novi

Whoops, stupid error on my part. I was thinking I wanted to do the maximize
in the 2nd DB that was opened. I just execute it when the appl first opens,
that did the trick. The statement I used was not just plain old Maximize,
though. It was
'RunCommand acCmdAppMaximize'. Just doing a regular DOCmd.Maximize doesn't
work because it doesn't maximize the Windows window, just the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top