Results 1 to 7 of 7
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    Appropriate event for DoCmd.Restore, DoCmd.Maximize, etc


    Does it matter, and if so why, whether one puts DoCmd.Restore in the OnLoad or OnOpen events. I had a case earlier where no matter where I put the form size commands the form would always open showing basically the Header Section.

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Can you clarify what you mean by "...always open showing basically the Header Section."? Do you mean you see only the form header, and no other fields? If so, I don't think it's a form size issue - it's more likely to mean the form has no data to display, and cannot add new records.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    By "Header Section", I mean it's as though one had opened maximized then "grabbed" the bottom of the window with sizing arrow and dragged the bottom of the window up to the point where only the Header Section remained.

    Having then sized the window to the desired display, I subsequently re-opened the window wherein its OnOpen Event code issued the DoCmd.Restore. Yet, the window continued to open sized to where only the header portion was visible until I once again dragged the bottom boarder down.

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    That's not how the DoCmd.Restore works. The Restore resizes a maximized or minimized form to its previous size while it was open. Access does not "remember" the last size the form was on the screen after you close it.

    You can fix this by going to design view, and make all sections of the form the size you want Set the Auto Resize property of the form to "Yes", and save the form. The next time you open it, it should be the correct size, and you don't need the resize commands.

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Here's the key misunderstanding on my part (you wrote): "Access does not "remember" the last size the form was on the screen after you close it." Somehow, I interpreted the HELP text to imply that Access did remember.

    Thanks,
    Bill
    (PS) As an aside, do you know how to obtain the "Top" property of a text box on a continuous form? Access doesn't seem to support the "Top" method from within an OnClick event. OnMouse Down gets close, but not spot on.

  6. #6
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You can retrieve the value of the "Top" property ( me![textboxname].top ), but I don't think it will give you what you are looking for - I tried it it on a continuous view, and it gave me the same value no matter which one I clicked. The "Top" is more a design view feature.

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Thanks, and as I expected.

    I like to use Allen's pop-up calendar and I like to "Move" it close to where the target text box is displayed. I'll be as creative as I can get with the "Y" value returned by the "MouseDown" Event. The "X" value is known and constant on a continuous form.

    Thanks again,
    Bill

Please reply to this thread with any new information or opinions.

Similar Threads

  1. DoCmd to Export?
    By aellistechsupport in forum Modules
    Replies: 20
    Last Post: 04-29-2014, 12:57 PM
  2. Replies: 10
    Last Post: 03-12-2013, 01:41 PM
  3. docmd.maximize (2003 to 2010)
    By redbull in forum Forms
    Replies: 1
    Last Post: 08-02-2012, 05:28 PM
  4. DoCmd. Question
    By Trojnfn in forum Access
    Replies: 4
    Last Post: 09-30-2011, 04:51 PM
  5. What actually happens at docmd.openform
    By Beorn in forum Programming
    Replies: 4
    Last Post: 01-05-2011, 02:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums