PDA

View Full Version : Solved: Calendar value to form



lifeson
07-26-2007, 06:53 AM
I have a calendar form which is launched by a double click on a textbox on a seperate form. (frmDetail)
I want the calendar value to populate the text box on the original form

I have tried the following with no luck

Private Sub Calendar1_Click()
' Transfer date selected on calendar to active cell
' and close UserForm.
'ActiveCell.Value = Calendar1.Value
'ActiveControl.Value = Calendar1.Value
frmDetail.ActiveControl = Calendar1.Value

End Sub

Active cell works if the calendar is launched on a sheet so I know the calendar works.

malik641
07-26-2007, 07:42 AM
Hi lifeson,

Try calling out the Textbox explicitly in the code (with the form's name preceding it):

This is untested, btw...
Private Sub Calendar1_Click()
' Transfer date selected on calendar to active cell
' and close UserForm.
frmDetail.Textbox1.Text = Calendar1.Value

End Sub

Hope this helps!

lifeson
07-26-2007, 08:59 AM
Hi lifeson,

Try calling out the Textbox explicitly in the code (with the form's name preceding it):

This is untested, btw...
Private Sub Calendar1_Click()
' Transfer date selected on calendar to active cell
' and close UserForm.
frmDetail.Textbox1.Text = Calendar1.Value

End Sub

Hope this helps!

Thanks Malik that worked fine