calling calendar, get Automation Error

A

Arnold Klapheck

I have a form that calls on the calendar control but I get this error.
Automation Error -2147417848 The object invoked has disconnected from its
clients

below is the code:

Private Sub cboDateReq_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)

CalendarReq.Visible = True
CalendarReq.SetFocus

If Not IsNull(cboDateReq) Then
CalendarReq.Value = cboDateReq.Value
Else
CalendarReq.Value = Date
End If

End Sub

I get the error message in the above code
 
N

NickHK

Arnold,
What do you expect from this line ?
If Not IsNull(cboDateReq) Then

Do you mean
If cboDateReq.ListIndex=-1 Then
'No selection made

Also, do you need the :
CalendarReq.SetFocus

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top