Solved

How to Maximise an Access form when MS Access application restores

Posted on 2014-02-08
4
938 Views
Last Modified: 2014-02-08
I am using the Access Window Manipulation code from http://access.mvps.org/access/api/api0019.htm to minimise an access window which contains a modular pop up form which maximise on open.

I have a button on the form to minimise the application of its onclick even :-
fSetAccessWindow(SW_SHOWMINIMIZED)

Everything works fine until I try to restore the application by click the access icon on the taskbar. The application restores but the form does not maximise.

I have experiment with an onclick event on the form to maximise it when click and that works but I'd prefer an event that triggers automatically when the aplication restores.

So the question is how do I programatically maximise an access form when the application restores.
0
Comment
Question by:Sheils
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39844560
Put DoCmd.Maximize after the call to fSetAccessWindow(SW_SHOWMAXIMIZED)
0
 
LVL 16

Author Comment

by:Sheils
ID: 39844564
Tried that, it does not change anything.
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 39844607
Ok I see the problem.

Copy this to the form:
Private Sub Form_Resize()
    Me.TimerInterval = 1
End Sub

Private Sub Form_Timer()
    DoCmd.Maximize
    Me.TimerInterval = Empty
End Sub

Open in new window

0
 
LVL 16

Author Closing Comment

by:Sheils
ID: 39844696
That works like a charm. However, I made a little modification because I have an unbounded text box on the form that uses the ontimer event to display the time. This may be handy for viewers who want to this code but continue using the on timer event for other things. The modified code is as follows:

Private Sub Form_Resize()

'Set timer to 1 millisecong and the maximise boolean to true
Me.TimerInterval = 1
booMaximise = True

End Sub

Private Sub Form_Timer()

Me.txtClock = Now() 'Reset the clock textbox every second

If booMaximise = True Then 'Only run this code when booMaximise is true. True is set in the on Resize event

booMaximise = False 'Reset the booMaximise to false so that the clock will still run
DoCmd.Maximize 'Maximise the form
Me.TimerInterval = 1000 'Reset the time interval to 1 second

End If

End Sub
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question