• Calendar Hide (2000)

    Author
    Topic
    #456507

    Hi, I have an active x calendar control that is hidden on my form and becomes visible on a button click. When I have used it to populated a date field with a date I need it to become not visible. I have wrestled with lostfocus etc and can’t seem to get it working. Any tips are welcome.

    Thanks Darren.

    Viewing 0 reply threads
    Author
    Replies
    • #1140966

      I’d use the After Update event of the calendar. This is not listed in the Event tab of the Properties window, but you can still use it.
      (In the form’s VBA module, select the calendar from the Object dropdown in the upper left, then select AfterUpdate from the Procedure dropdown in the upper right)
      You must set focus to another control before hiding the calendar.

      For example:

      Private Sub Calendar0_AfterUpdate()
      ‘ Populate text box
      Me.Text2 = Me.Calendar0
      ‘ Set focus to text box
      Me.Text2.SetFocus
      ‘ Hide calendar
      Me.Calendar0.Visible = False
      End Sub

    Viewing 0 reply threads
    Reply To: Calendar Hide (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: