Function OpenCalendar(strForm As String, strCtrl As String) As Date
DoCmd.OpenForm "frmCalendar"
Forms!frmCalendar.Caption = "Select " & strCtrl
Forms!frmCalendar!FormName = strForm
Forms!frmCalendar!ControlName = strCtrl
End Function
Sub SetDate()
Dim strForm
Dim strCtrl
Dim wd As Date
wd = Forms!frmCalendar!Calendar3.Value
strForm = Forms!frmCalendar!FormName
strCtrl = Forms!frmCalendar!ControlName
Forms(strForm)(strCtrl).Value = wd
Forms(strForm)(strCtrl).SetFocus
Forms(strForm).Requery
' Forms!frmCalendar.Visible = False
DoCmd.Close acForm, "frmCalendar"
End Sub
|