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.
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.
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.
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.
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.
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.
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.
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