PDA

View Full Version : Calender Control



av8tordude
01-09-2009, 08:17 PM
I have two userforms that I want to call the calendar control. Currently I have a calendar control for each userform. Is it possible to have only 1-calendar control being used by 2-userformsl?


Private Sub Calendar1_Click()
frmLogbook.txtDate = Calendar1.Value

frmFlt.txtDate = Calendar1.Value
Unload Me
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Calendar1.Value = DateValue(frmLogbook.txtDate.Value)

Calendar1.Value = DateValue(frmFlt.txtDate.Value)

End Sub

lucas
01-09-2009, 11:43 PM
The only way I can see to do it is if both userforms are open when you click the calendar. Otherwise you will have to store the date in a global variable or a range on the sheet for the other userform to retrieve.

Someone else might have an idea.

Any time I see someone dealing with calendar controls I always point them to this thread......it's worth your time to read, especially from post #7 on.

http://www.vbaexpress.com/forum/showthread.php?t=10914