RiazKhanmohamed
Programmer
- Oct 30, 2002
- 115
I have a form with a textfield that, when I double click on it, opens up another form with a calendar on it. When i double click that, I want the date to be returned to the original textfield. Having searched around on this site, I have set a global variable in the original form:
ctl As Control
On double clicking my textfield, i do this:
**************8
Private Sub FName_DblClick(Cancel As Integer)
Me.Refresh
Set ctl = Forms![RequestHoliday Detail Subform]![FName Date]
Dim stDocName As String
stDocName = "frm_date" 'name of form containing Active X calendar
DoCmd.OpenForm stDocName
End Sub
**********
frm_date is my calendar form, RequestHoliday is my original form. FName is the field (i am just practicing before confirming the names.)
on my calendar form, i have this code:
**********8
Private Sub CalendarBox_DblClick()
Dim d As String, e As Date
'On DblClick, the active datefield on specified form is changed to calendar date
ctl = Me!CalendarBox.Value
'Close
End Sub
***************8
CalendarBox is my calendar ActiveX process.
Please help - it doesn't like ctl, and i just want the date to appear in the other field. The date types are the same, and i'm not sure if the second form is a sub form or just another form, hence not taking in the ctl variable.
Is there a simple solution?
ctl As Control
On double clicking my textfield, i do this:
**************8
Private Sub FName_DblClick(Cancel As Integer)
Me.Refresh
Set ctl = Forms![RequestHoliday Detail Subform]![FName Date]
Dim stDocName As String
stDocName = "frm_date" 'name of form containing Active X calendar
DoCmd.OpenForm stDocName
End Sub
**********
frm_date is my calendar form, RequestHoliday is my original form. FName is the field (i am just practicing before confirming the names.)
on my calendar form, i have this code:
**********8
Private Sub CalendarBox_DblClick()
Dim d As String, e As Date
'On DblClick, the active datefield on specified form is changed to calendar date
ctl = Me!CalendarBox.Value
'Close
End Sub
***************8
CalendarBox is my calendar ActiveX process.
Please help - it doesn't like ctl, and i just want the date to appear in the other field. The date types are the same, and i'm not sure if the second form is a sub form or just another form, hence not taking in the ctl variable.
Is there a simple solution?