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
"Mike Painter" wrote:
[Quoted Text] > 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. > > > NickG1 wrote: > > 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. > > >
|