Calendar Active Control

N

NickG1

How can I have a calendar control become invisible when, if before a date is
selected/clicked, another part of the form is clicked or the user moves to
another record?

The problem is that if the user does not select a date but clicks another
part of the form or moves to another reocrd, the calendar control remains
visible.
 
M

Mike Painter

Move to 2007 :)
or

Start with it invisible and make it visible when the control gets the focus,
then make it invisible when it looses focus.
I'd probably go with this but you could also use On Enter.
 
N

NickG1

When U use the On LostFocus event, I get the error "You can't hide a control
that
has the focus.".

Private Sub requestdate_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Calendar_control.Visible = True
Calendar_control.SetFocus
If Not IsNull(requestdate) Then
Calendar_control.Value = requestdate.Value
Else
Calendar_control.Value = Date
End If
End Sub

Private Sub Calendar_control_LostFocus()
Calendar_control.Visible = False
End Sub


Private Sub Calendar_control_click()
requestdate.Value = Calendar_control.Value
requestdate.SetFocus
Calendar_control.Visible = False
End Sub
 

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