Using the MonthView Control But Cannot Update the Text Field on Another Form

  • Thread starter Thread starter John Davis
  • Start date Start date
J

John Davis

I am writing a program that allows user to select the date in
a calendar, and it will update the text fields automatically.

I created 2 forms. The first form has 2 text fields (start date and
end date), and 2 buttons. When the user clicks the button, it will
invoke the calendar form. Here's the code fragment for the first form:

Private Sub Command1_Click()
Dim instanceCalendarForm As CalendarForm
Set instanceCalendarForm = New CalendarForm
instanceCalendarForm.Show
End Sub

Public Sub setTextDate(aDate As String)
startText.Text = aDate
startText.Refresh
End Sub

The second form contains the MonthView activeX control. I am not sure
if I can invoke a MonthView control without putting in on another form.
Any ideas? Here's the code fragment for the second form:

Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
startDate = MonthView1.Month & "/" & MonthView1.Day & "/" &
MonthView1.Year
instanceForm1.setTextDate (startDate)
End Sub


The problem is I cannot update the text field in form1 even the user clicks
the
date on calendar control. Any ideas?? Please advice. Thanks!!!



John
 
Please pick a technology and stick with it. The .NET folks don't want VB6
questions any more than we in the *.vb.* groups want .NET questions. In
other words, please don't crosspost between *.dotnet.* and *.vb.* groups.
 
Back
Top