Unless someone can tell me how to determine which record within the current RecordSet is being displayed at the top of the detail section of the current continuous form, below is my best solution.
Code:
Private Sub tbDOE_Click()
Dim dummy As Date
Dim intMaxCalTop
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
' Other than launching Allen Browne's pop-up calendar, the primary task is to determine
' as well as can be the "Top" coordinate for the pop-up.
'
' Things only become un-certain when the display is scrolled beyond where the first
' record "displayed" IS NOT also the first record in the RecordSet. To make the
' best of the situation, we take into consideration the current window height minus
' the current height of the detail section minus the amount of space occupied by the
' top and bottom of the the window and use that to set the maximum value to be used
' in positioning the top of the pop-up calendar. Not the best, but handles 99% of
' the observed cases.
'
' intCalTop and intCalLeft are global and used by frmCalendar to position itself.
'
' DetailHt is the amount of vertical space used to display one record within the
' Detail section of the display. NOT THE SAME as Me.tbDOE.Height
'
' CalMidLine is the offset from the top of frmCalendar to the horizontal line between
' the days of the week and days of the month.
'
' ALL values are in Twips
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
intMaxCalTop = Me.WindowHeight - Me.Section(1).Height - intWinFraming - DetailHt
intCalTop = Me.WindowTop + Me.Section(1).Height + Me.CurrentRecord * DetailHt - CalMidLine - DetailHt
If intCalTop > intMaxCalTop Then intCalTop = intMaxCalTop - CalMidLine
intCalLeft = Me.WindowLeft + Me.tbDOE.Left + 1260 + 200 'plus some emperical values to tweek the position
dummy = CalendarFor([tbDOE], "Date of Transaction")
End Sub