'Author: Allen Browne. allen@allenbrowne.com
'You may use this example for private, business, or educational purposes, with acknowledgement.
'However, you may not publish it without the express, written permission of the author.
'You also need this code in a standard module:
'---------------------standard module code begins-------------------------
'Public gtxtCalTarget As TextBox 'Text box to return the date from the calendar to.
'Public Function DatePickerFor(txt As TextBox, Optional strTitle As String)
'On Error GoTo Err_Handler
' 'Purpose: Open the calendar form, identifying the text box to return the date to.
' 'Arguments: txt = the text box to return the date to.
' ' strTitle = the caption for the calendar form (passed in OpenArgs).
'
' Set gtxtCalTarget = txt
' DoCmd.OpenForm "frmDatePicker", windowmode:=acDialog, OpenArgs:=strTitle
'
'Exit_Handler:
' Exit Function
'
'Err_Handler:
' MsgBox "Error " & Err.Number & " - " & Err.Description, vbExclamation, "DatePickerFor()"
' Resume Exit_Handler
'End Function