AutoExec

B

BBran

Hello,

In Access 2000 I used an AutoExec macro to Maximize all objects that opened. For some reason that doesn't work in Access 2007 B2TR, even when using the overlapping windows option.

Any suggestions how to get all objects to open maximized without having to set each one to do so individually?

--

Respectfully,
Bob Brannon

..
 
A

Allen Browne

Bob, I can't comment on the beta, the final release of A2007 works fine in
overlapping windows view when you call a macro in the form's Open or Load
event, with the Maximize option.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Hello,

In Access 2000 I used an AutoExec macro to Maximize all objects that opened.
For some reason that doesn't work in Access 2007 B2TR, even when using the
overlapping windows option.

Any suggestions how to get all objects to open maximized without having to
set each one to do so individually?

--

Respectfully,
Bob Brannon

..
 
B

BBran

Allen,

I know I could set that event for each form, query, report, etc. But I am looking for a way to have this done automatically, no matter what I open first.

In 2000 I had an AutoExec macro that maximized the active object immediately on opening the database. If I remember, it kept active whatever object was open when one exited Access. Even if that is not correct, the point is I did not have to maximize an object when I opened it, it already was because of the AutoExec macro (in which I had the Maximize action) that ran at startup.

So, is there some way to do this in 2007 without having to set each objects Open or Load event to maximize? I don't know which object I will open each time until I start each session. I have a different need each time, usually.

--

Respectfully,
Bob Brannon




Bob, I can't comment on the beta, the final release of A2007 works fine in
overlapping windows view when you call a macro in the form's Open or Load
event, with the Maximize option.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Hello,

In Access 2000 I used an AutoExec macro to Maximize all objects that opened.
For some reason that doesn't work in Access 2007 B2TR, even when using the
overlapping windows option.

Any suggestions how to get all objects to open maximized without having to
set each one to do so individually?

--

Respectfully,
Bob Brannon

..
 
A

Allen Browne

Bob, I just tried an AutoExec macro with these 2 actions:
OpenForm
Maximize

On opening the database, the specified form opened, and maximzed.
Then other forms maximed also.

Not sure that's what you were asking.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Allen,

I know I could set that event for each form, query, report, etc. But I am
looking for a way to have this done automatically, no matter what I open
first.

In 2000 I had an AutoExec macro that maximized the active object immediately
on opening the database. If I remember, it kept active whatever object was
open when one exited Access. Even if that is not correct, the point is I
did not have to maximize an object when I opened it, it already was because
of the AutoExec macro (in which I had the Maximize action) that ran at
startup.

So, is there some way to do this in 2007 without having to set each objects
Open or Load event to maximize? I don't know which object I will open each
time until I start each session. I have a different need each time,
usually.

--

Respectfully,
Bob Brannon


Bob, I can't comment on the beta, the final release of A2007 works fine in
overlapping windows view when you call a macro in the form's Open or Load
event, with the Maximize option.

Hello,

In Access 2000 I used an AutoExec macro to Maximize all objects that opened.
For some reason that doesn't work in Access 2007 B2TR, even when using the
overlapping windows option.

Any suggestions how to get all objects to open maximized without having to
set each one to do so individually?
 
B

BBran

Allen,

I tried that and it works, but when I close the form, the next thing I open is not maximized. The only way to have the next or other things maximized is to keep something open that is maximized. The AutoExec I had in 2000 did not specify an object it just had the maximize action and then whenever I opened anything it would open maximized, even if nothing else was already open. Any way to do that?

Bob



Bob, I just tried an AutoExec macro with these 2 actions:
OpenForm
Maximize

On opening the database, the specified form opened, and maximzed.
Then other forms maximed also.

Not sure that's what you were asking.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Allen,

I know I could set that event for each form, query, report, etc. But I am
looking for a way to have this done automatically, no matter what I open
first.

In 2000 I had an AutoExec macro that maximized the active object immediately
on opening the database. If I remember, it kept active whatever object was
open when one exited Access. Even if that is not correct, the point is I
did not have to maximize an object when I opened it, it already was because
of the AutoExec macro (in which I had the Maximize action) that ran at
startup.

So, is there some way to do this in 2007 without having to set each objects
Open or Load event to maximize? I don't know which object I will open each
time until I start each session. I have a different need each time,
usually.

--

Respectfully,
Bob Brannon


Bob, I can't comment on the beta, the final release of A2007 works fine in
overlapping windows view when you call a macro in the form's Open or Load
event, with the Maximize option.

Hello,

In Access 2000 I used an AutoExec macro to Maximize all objects that opened.
For some reason that doesn't work in Access 2007 B2TR, even when using the
overlapping windows option.

Any suggestions how to get all objects to open maximized without having to
set each one to do so individually?
 
A

Allen Browne

Ah, I understand what you are saying now.

In earlier versions of Access, when you closed your maximized forms/reports,
the Database window took focus, and it was maximized. In Access 2007 there
is no DB window, and the NavPane does not maximize. At this point, Access
has lost track of the fact that the child windows were maximized, so the
next window that opens is not maximized.

To avoid that, you will need to add the Maximize action/method to the Open
event of each form and report, or else to use a custom method of opening
them so they maximize. (See below.) But I would have thought that the tabbed
window method would be perfect for this situation? I actually found it
confusing trying to switch from one maximized window to another in A2007:
there might be a way, but without the Window menu, it's not obvious. The
tabs make this so easy that it seems like the obvious choice? (Or perhaps
you don't want the user switching back to another open form?)

If you want to proceed, you could create a function like the one below. Then
you can do a global search'n'replace, replacing:
DoCmd.OpenForm
with:
OpenTheForm

Public Function OpenTheForm(FormName As String, _
Optional View As AcFormView, _
Optional FilterName, _
Optional WhereCondition, _
Optional DataMode As AcFormOpenDataMode, _
Optional WindowMode As AcWindowMode = acWindowNormal, _
Optional OpenArgs) As Boolean
On Error GoTo Err_Error
'Purpose: Open a form and maximize it.
'Return: True if the form opened. False on error.

DoCmd.OpenForm FormName, View, FilterName, WhereCondition, DataMode,
WindowMode, OpenArgs
DoCmd.Maximize

Exit_Handler:
Exit Function

Err_Error:
If Err.Number <> 2501 Then
MsgBox "Error " & Err.Number & ": " & Err.Description,
vbExclamation, ".OpenTheForm"
End If
Resume Exit_Handler
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Allen,

I tried that and it works, but when I close the form, the next thing I open
is not maximized. The only way to have the next or other things maximized
is to keep something open that is maximized. The AutoExec I had in 2000 did
not specify an object it just had the maximize action and then whenever I
opened anything it would open maximized, even if nothing else was already
open. Any way to do that?

Bob

Bob, I just tried an AutoExec macro with these 2 actions:
OpenForm
Maximize

On opening the database, the specified form opened, and maximzed.
Then other forms maximed also.

Not sure that's what you were asking.

Allen,

I know I could set that event for each form, query, report, etc. But I am
looking for a way to have this done automatically, no matter what I open
first.

In 2000 I had an AutoExec macro that maximized the active object immediately
on opening the database. If I remember, it kept active whatever object was
open when one exited Access. Even if that is not correct, the point is I
did not have to maximize an object when I opened it, it already was because
of the AutoExec macro (in which I had the Maximize action) that ran at
startup.

So, is there some way to do this in 2007 without having to set each objects
Open or Load event to maximize? I don't know which object I will open each
time until I start each session. I have a different need each time,
usually.

--

Respectfully,
Bob Brannon


Bob, I can't comment on the beta, the final release of A2007 works fine in
overlapping windows view when you call a macro in the form's Open or Load
event, with the Maximize option.

Hello,

In Access 2000 I used an AutoExec macro to Maximize all objects that opened.
For some reason that doesn't work in Access 2007 B2TR, even when using the
overlapping windows option.

Any suggestions how to get all objects to open maximized without having to
set each one to do so individually?
 
B

BBran

Allen,

Thanks for getting back. I hadn't even thought about the tabbed window option. I will see how that works. If not I'll try your method below, and get back either way.

Merry Christmas!
Bob


Ah, I understand what you are saying now.

In earlier versions of Access, when you closed your maximized forms/reports,
the Database window took focus, and it was maximized. In Access 2007 there
is no DB window, and the NavPane does not maximize. At this point, Access
has lost track of the fact that the child windows were maximized, so the
next window that opens is not maximized.

To avoid that, you will need to add the Maximize action/method to the Open
event of each form and report, or else to use a custom method of opening
them so they maximize. (See below.) But I would have thought that the tabbed
window method would be perfect for this situation? I actually found it
confusing trying to switch from one maximized window to another in A2007:
there might be a way, but without the Window menu, it's not obvious. The
tabs make this so easy that it seems like the obvious choice? (Or perhaps
you don't want the user switching back to another open form?)

If you want to proceed, you could create a function like the one below. Then
you can do a global search'n'replace, replacing:
DoCmd.OpenForm
with:
OpenTheForm

Public Function OpenTheForm(FormName As String, _
Optional View As AcFormView, _
Optional FilterName, _
Optional WhereCondition, _
Optional DataMode As AcFormOpenDataMode, _
Optional WindowMode As AcWindowMode = acWindowNormal, _
Optional OpenArgs) As Boolean
On Error GoTo Err_Error
'Purpose: Open a form and maximize it.
'Return: True if the form opened. False on error.

DoCmd.OpenForm FormName, View, FilterName, WhereCondition, DataMode,
WindowMode, OpenArgs
DoCmd.Maximize

Exit_Handler:
Exit Function

Err_Error:
If Err.Number <> 2501 Then
MsgBox "Error " & Err.Number & ": " & Err.Description,
vbExclamation, ".OpenTheForm"
End If
Resume Exit_Handler
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Allen,

I tried that and it works, but when I close the form, the next thing I open
is not maximized. The only way to have the next or other things maximized
is to keep something open that is maximized. The AutoExec I had in 2000 did
not specify an object it just had the maximize action and then whenever I
opened anything it would open maximized, even if nothing else was already
open. Any way to do that?

Bob

Bob, I just tried an AutoExec macro with these 2 actions:
OpenForm
Maximize

On opening the database, the specified form opened, and maximzed.
Then other forms maximed also.

Not sure that's what you were asking.

Allen,

I know I could set that event for each form, query, report, etc. But I am
looking for a way to have this done automatically, no matter what I open
first.

In 2000 I had an AutoExec macro that maximized the active object immediately
on opening the database. If I remember, it kept active whatever object was
open when one exited Access. Even if that is not correct, the point is I
did not have to maximize an object when I opened it, it already was because
of the AutoExec macro (in which I had the Maximize action) that ran at
startup.

So, is there some way to do this in 2007 without having to set each objects
Open or Load event to maximize? I don't know which object I will open each
time until I start each session. I have a different need each time,
usually.

--

Respectfully,
Bob Brannon


Bob, I can't comment on the beta, the final release of A2007 works fine in
overlapping windows view when you call a macro in the form's Open or Load
event, with the Maximize option.

Hello,

In Access 2000 I used an AutoExec macro to Maximize all objects that opened.
For some reason that doesn't work in Access 2007 B2TR, even when using the
overlapping windows option.

Any suggestions how to get all objects to open maximized without having to
set each one to do so individually?
 
B

BBran

Yup! I should have tried the tabbed option, it is perfect for my situation!

Thanks,
Bob


Allen,

Thanks for getting back. I hadn't even thought about the tabbed window option. I will see how that works. If not I'll try your method below, and get back either way.

Merry Christmas!
Bob


Ah, I understand what you are saying now.

In earlier versions of Access, when you closed your maximized forms/reports,
the Database window took focus, and it was maximized. In Access 2007 there
is no DB window, and the NavPane does not maximize. At this point, Access
has lost track of the fact that the child windows were maximized, so the
next window that opens is not maximized.

To avoid that, you will need to add the Maximize action/method to the Open
event of each form and report, or else to use a custom method of opening
them so they maximize. (See below.) But I would have thought that the tabbed
window method would be perfect for this situation? I actually found it
confusing trying to switch from one maximized window to another in A2007:
there might be a way, but without the Window menu, it's not obvious. The
tabs make this so easy that it seems like the obvious choice? (Or perhaps
you don't want the user switching back to another open form?)

If you want to proceed, you could create a function like the one below. Then
you can do a global search'n'replace, replacing:
DoCmd.OpenForm
with:
OpenTheForm

Public Function OpenTheForm(FormName As String, _
Optional View As AcFormView, _
Optional FilterName, _
Optional WhereCondition, _
Optional DataMode As AcFormOpenDataMode, _
Optional WindowMode As AcWindowMode = acWindowNormal, _
Optional OpenArgs) As Boolean
On Error GoTo Err_Error
'Purpose: Open a form and maximize it.
'Return: True if the form opened. False on error.

DoCmd.OpenForm FormName, View, FilterName, WhereCondition, DataMode,
WindowMode, OpenArgs
DoCmd.Maximize

Exit_Handler:
Exit Function

Err_Error:
If Err.Number <> 2501 Then
MsgBox "Error " & Err.Number & ": " & Err.Description,
vbExclamation, ".OpenTheForm"
End If
Resume Exit_Handler
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Allen,

I tried that and it works, but when I close the form, the next thing I open
is not maximized. The only way to have the next or other things maximized
is to keep something open that is maximized. The AutoExec I had in 2000 did
not specify an object it just had the maximize action and then whenever I
opened anything it would open maximized, even if nothing else was already
open. Any way to do that?

Bob

Bob, I just tried an AutoExec macro with these 2 actions:
OpenForm
Maximize

On opening the database, the specified form opened, and maximzed.
Then other forms maximed also.

Not sure that's what you were asking.

Allen,

I know I could set that event for each form, query, report, etc. But I am
looking for a way to have this done automatically, no matter what I open
first.

In 2000 I had an AutoExec macro that maximized the active object immediately
on opening the database. If I remember, it kept active whatever object was
open when one exited Access. Even if that is not correct, the point is I
did not have to maximize an object when I opened it, it already was because
of the AutoExec macro (in which I had the Maximize action) that ran at
startup.

So, is there some way to do this in 2007 without having to set each objects
Open or Load event to maximize? I don't know which object I will open each
time until I start each session. I have a different need each time,
usually.

--

Respectfully,
Bob Brannon


Bob, I can't comment on the beta, the final release of A2007 works fine in
overlapping windows view when you call a macro in the form's Open or Load
event, with the Maximize option.

Hello,

In Access 2000 I used an AutoExec macro to Maximize all objects that opened.
For some reason that doesn't work in Access 2007 B2TR, even when using the
overlapping windows option.

Any suggestions how to get all objects to open maximized without having to
set each one to do so individually?
 

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