D
dplove
I have written the code to have a calendar pop up when clicking on a combo
box called Date Shipped. It worked fine. I then realized that I had two
more date fields that I would like for this calendar to pop up when clicked.
One is called "Lease term Begin Date" & "Lease term End Date". When I build
the code for the Lease term Begin date I get the following error message
"The expression On Mouse Down you entered as the event property setting
produced the following error:Member already exits in an object module from
which this object module derives."
Here is what my code says:
Option Compare Database
Dim Lease_term_Begin_Date As ComboBox
Private Sub Date_Shipped_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub Date_Shipped_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Set Lease_term_Begin_Date = Date_Shipped
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(Date_Shipped) Then
ocxCalendar.Value = Date_Shipped.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub Lease_term_Begin_Date_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub Lease_term_Begin_Date_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(Lease_term_Begin_Date) Then
ocxCalendar.Value = Lease_term_Begin_Date.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub ocxCalendar_Click()
Lease_term_Begin_Date.Value = ocxCalendar.Value
Lease_term_Begin_Date.SetFocus
ocxCalendar.Visible = False
Set Lease_term_Begin_Date = Nothing
End Sub
Private Sub ocxCalendar_Updated(Code As Integer)
End Sub
This line "Set Lease_term_Begin_Date = Date_Shipped " I also put in the
"Private Sub Lease_term_Begin_Date_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)" and it didnt' work.
All the text boxes where changed to combo boxes. I have not had a change
to try the calendar on the third date field because I can't get the second
one to work. With the code above it doesn't allow my first date field to
work. If I remove everything for the second date field it will work again.
Please tell me what is wrong in this code!!!!
Thanks
box called Date Shipped. It worked fine. I then realized that I had two
more date fields that I would like for this calendar to pop up when clicked.
One is called "Lease term Begin Date" & "Lease term End Date". When I build
the code for the Lease term Begin date I get the following error message
"The expression On Mouse Down you entered as the event property setting
produced the following error:Member already exits in an object module from
which this object module derives."
Here is what my code says:
Option Compare Database
Dim Lease_term_Begin_Date As ComboBox
Private Sub Date_Shipped_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub Date_Shipped_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Set Lease_term_Begin_Date = Date_Shipped
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(Date_Shipped) Then
ocxCalendar.Value = Date_Shipped.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub Lease_term_Begin_Date_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub Lease_term_Begin_Date_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(Lease_term_Begin_Date) Then
ocxCalendar.Value = Lease_term_Begin_Date.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub ocxCalendar_Click()
Lease_term_Begin_Date.Value = ocxCalendar.Value
Lease_term_Begin_Date.SetFocus
ocxCalendar.Visible = False
Set Lease_term_Begin_Date = Nothing
End Sub
Private Sub ocxCalendar_Updated(Code As Integer)
End Sub
This line "Set Lease_term_Begin_Date = Date_Shipped " I also put in the
"Private Sub Lease_term_Begin_Date_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)" and it didnt' work.
All the text boxes where changed to combo boxes. I have not had a change
to try the calendar on the third date field because I can't get the second
one to work. With the code above it doesn't allow my first date field to
work. If I remove everything for the second date field it will work again.
Please tell me what is wrong in this code!!!!
Thanks