Not being completely satisfied with the many ActiveX-less date picker solutions out there (though many are quite good), I decided to build my own. I'm setting it up so that when the user clicks a button the calendar pops up immediately beneath the associated date field, sorta like an ActiveX date picker would. I'm using the following calculation to determine where the calendar form should be positioned when it opens, then the Move method to position the form at the desired coordinates:
The left positioning works just fine. As you can see, the top positioning simply sums the form's distance from the top of the Access window, the control's distance from the top of the form, and the date field's height to theoretically arrive at the bottom edge of the date field. But it doesn't put the calendar form at the bottom edge of the date field, it's slightly above the top edge of the field. If I add 320 twips to the sum it positions it about right, but I'm curious why this is so. Is there a margin or a scrollbar dimension (no scrollbars on this form) or some such that I'm failing to account for?
Thanks for any insight.
Ken S.
Code:
p_TopPos = Me.WindowTop + Me!txtMyDate.Top + Me!txtMyDate.Height
p_LeftPos = Me.WindowLeft + Me!txtMyDate.Left
Thanks for any insight.
Ken S.