Solved

How to Maximise an Access form when MS Access application restores

Posted on 2014-02-08
4
932 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

752 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