Results 1 to 2 of 2
Thread: Passing calendar values (2002)
2006-07-10, 11:34 #1
- Join Date
- Mar 2001
- Thanked 0 Times in 0 Posts
Passing calendar values (2002)
I have three date fields and want to have buttons next to their text boxes that open a calendar form to allow the date to be selected. I'm trying to use OpenArgs for the calendar form to set the start date to display in the calendar. The OpenArgs are set to, for example, txtStartDate (the text box on the main form) and I then try to set the calendar's value to this date using the Open Event of the calendar form.
However, the date shown of the calendar doesn't change, even if I try CDate(txtStartDate). What might the problem be? How would you suggest I return a new date value to the main form? Thanks, Andy.
2006-07-10, 11:49 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: Passing calendar values (2002)
Use the On Load event instead of the On Open event. On Open occurs too early.
You can set the value of a text box on the main form to the value of the calendar control:
Private Sub Calendar0_AfterUpdate()
Forms!frmMain!txtStartDate = Me!Calendar0
where frmMain is the name of the main form and Calendar0 is the name of the calendar control.