Problem with ocxCalendar (code)

law

Registered User.
Local time
Today, 13:17
Joined
Feb 14, 2004
Messages
26
--------------------------------------------------------------------------------

I have a form which has two combo boxes start Date and End Date and I am using a calendar activeX control. Anyway I have added the code below where an error is been generated. I have a check that makes sure that the end date is after the start date and if the end date isnt after the start date then an error message is displayed which is fine (that works great). But when the error message displays if you click OK on the message box to continue a RUN TIME error appears stating "cant move the focus to the
control cboJobDetailsEndDate"

can anyone help please???

I have added cboDate as a global variable

Dim cboDate As comboBox

Private Sub ocxCalendar_Click()

cboDate.Value = ocxCalendar.Value
cboDate.SetFocus
ocxCalendar.Visible = False

Set cboDate = Nothing

End Sub
 
Somehwere in your code you have:
Code:
Me.cboJobDetailsEndDate.SetFocus

Just delete it i presume.
________
Hemi Small Block
 
Last edited:

Users who are viewing this thread

Back
Top Bottom