Results 1 to 15 of 15
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi everyone.

    I use a macro as the one shown below to open a particular form in my access database 2003. How can I keep it from opening in Maximized mode? In the form properties, I don't see anything that actually helps. I place Autocenter on YES and Autoresize on NO, and yet it still maximizes when someone opens the form. I have a preset size I want it to be (manually resized it and saved it that way). But turn around and on someone elses computer it will open maximized... Is there something I can add to the following code to tell it to keep its shape when it opens? I have the action in the code set to acNormal

    Code:
    Private Sub btnOpenfrmNannetteEnterRecords_Click()
    'Attached to On Click event of cmdOpenfrmNannetteEnterRecords
    
    Dim strPassword
    
    strPasswd = InputBox("Enter Password", "Restricted Form")
    
    'Check to see if there is any entry made to input box, or if
    'cancel button is pressed.  If no entry made then exit sub.
    
        If strPasswd = "" Or strPasswd = Empty Then
            MsgBox "No Input Provided", vbInformation, "Required Data"
            Exit Sub
            End If
    
    'If correct password is entered open frmNannetteEnterRecords
    'If incorrect password is entered give message and exit sub
    
        If strPasswd = "Nannette123" Then
            DoCmd.OpenForm "frmNannetteEnterRecords", acNormal
        Else
            MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important Information"
        Exit Sub
        End If
    End Sub
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The second argument acNormal has nothing to do with the window size - it specifies that the form opens in normal, i.e. form mode (as opposed to design mode, datasheet mode etc.)

    Is the form that contains btnOpenfrmNannetteEnterRecords maximized? If so, the other form will be opened maximized too.

    You could add a line

    DoCmd.Restore

    below the line with DoCmd.OpenForm.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Hans for the clarification on the code for acNormal

    The problem (even after entering your DoCmd.Restore is that when someone clicks on a macro button on the form (its of the proper size at the moment)...but when they click a button on the form for example to open another object like a datasheet, the datasheet opens in maximized mode, and when closed there is the form they originally used that maximized itself in the background instead of staying the size it was before the datasheet was open. It is like:

    1. The form is the perfect size
    2. Click a button on the form to open a datasheet in maximized mode
    3. Enter records.
    4. Close the datasheet
    5. There is the form used to enter the datasheet in the background but it grew (it maximized itself when the datasheet was open)

    Why can't it remain the size it was before?
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you maximize a window within the Access application window, you maximize ALL windows, not just the one you maximize explicitly.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Darn...was hoping to find a way around it. Thank you Hans for your feedback.
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You could add the line DoCmd.Restore to the On Close or On Deactivate event of the datasheet form.

  7. #7
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Quote Originally Posted by teachesms View Post
    Darn...was hoping to find a way around it. Thank you Hans for your feedback.
    There is another way to keep a form a fixed size, and that is to make it pop-up. Then even if the main Access window is maximized it will float over top of whatever else is open. Will that improve your situation?
    Wendell

  8. #8
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wendall,

    I will try this. Must wait until I can get back to the server on Monday, but definitly will give this a try. Thanks so much for the idea of the popup.
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  9. #9
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    You could add the line DoCmd.Restore to the On Close or On Deactivate event of the datasheet form.

    Hans, I will try both you and Wendells suggestions on Monday morning. Thanks you again. If either works will let you know.
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  10. #10
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by WendellB View Post
    There is another way to keep a form a fixed size, and that is to make it pop-up. Then even if the main Access window is maximized it will float over top of whatever else is open. Will that improve your situation?
    Wendell,

    Creating a pop up form works for keeping the size of the forms the same and stops the maximization of it when something is open. It keeps the size of the windows great, however, it does keep them in front of whatever you are opening, which I think will aggravate the person trying to open their reports etc...to view.

    On the "On Click" code event that I have at the beginning of this thread to open the example of "frmNannetteEnterRecords", would there be a command I could use to make the pop up form go to the back of whatever they are opening?
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can't send a popup form to the back of another window. But if you open popup form B from popup form A, it'll open in front of popup form A.

  12. #12
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    ...however, it does keep them in front of whatever you are opening, which I think will aggravate the person trying to open their reports etc...to view.
    Unfortunately pop-up forms are intended to do exactly that. Their use is intended for situations where you need to briefly see a bit of data. User Interface design is a challenge in nearly all systems design projects. We take the idea that in general you only have one form open at a time, and you use a menuing function to control that. Getting many forms open at once just confuses the user. Also, we almost never use the datasheet view - if users need to see data in that format, we export it to Excel, or we create a form. For what it's worth, we use the "Windows In the Taskbar" option in 2003 to let you click on reports and such, while in 2007 we use the tabbed documents option so the user can go to a specific window.
    Wendell

  13. #13
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wendell,

    Thank you. Yes, I am aware that users should not use the datasheet view. This database is a bit different...not the norm. That is why I am restructuring it...and the datasheets will appear in Add-Only mode when through. If they want to view anything else they must open the report.

    Appreciate all the help on this. Will work it out. Plus am rebuilding it on a 2007 Access loaded computer and have to make it complient with 2003 Access which everyone else has. What looks good in design on 2007 doesn't always appear as well in 2003.
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  14. #14
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    You can't send a popup form to the back of another window. But if you open popup form B from popup form A, it'll open in front of popup form A.
    Understood. And that is working fine. It was just after opening form B from from A (after entering DB Password), form B (which there are several as there are several directors)...has macros that open that particular Directors reports, etc...and the popups do what popups do...stay in front of everything. So...

    I had thought that as the user clicks a button on Form B to open a report, there would be a possible way of minimizing or closing form B in the On Lost focus event (or some event) to close the popup as the report would be the desired object to now have the focus. (Yet it remains in the background behind Form A and Form B as they are popups doing what I wanted them to do, staying the size they are supposed to be...however removing themselves from view would have been nice too)...can't have both. Now if Reports could be changed to popups, I'd be in the pink!

    solved

    they can be. thank you guys. sometimes we answer our own questions. that solved it. make the reports popups as well
    Anyway...
    Thank you for your help
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  15. #15
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Quote Originally Posted by teachesms View Post
    ... Plus am rebuilding it on a 2007 Access loaded computer and have to make it complient with 2003 Access which everyone else has. What looks good in design on 2007 doesn't always appear as well in 2003.
    That's an understatement - the general advice is to always do development on the older version of Access. Otherwise when you take it to an older version you may end up with missing references and things that work well in the new version, but don't in the older.

    Another option with popup forms is to hide the originating one (set the Visible property to False) when you open a new one, and then unhide it when the newer form is closed. That strategy works well until you have an issue with a form crashing or something. Then you end up with a hidden form you don't know you have.
    Wendell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •