Results 1 to 5 of 5
  1. #1

    Calendar Control Problem

    Hi All

    At present I have a form with a date field and a calendar control. I have linked the control to the date field so that when I click on a date it is entered into the field. However, I want to minimise the space taken up by the calendar control. Is there anyway I can shrink the control to the size of a small button? Then when I click the button the control expands and I can enter the date.

    Cheers, Kenny.

  2. #2

    Re: Calendar Control Problem

    I think that you want the Cal to be not visable but when it gets to the date field you wnat it to the Cal to pop-up

    If so
    1. you will Go to the properties of the Cal Object and set it to Hide on your Form View.

    2. Then you would it in the Code of the Form .

    So when it Set Focus on your Datefield the
    Cal.Visable = True

    I think that would work i have to look at an example i did later on today to give you the actaul correct way if that is wrong


  3. #3

    Re: Calendar Control Problem

    Thanks. I tried what you said and now I have a date field that sets the Calendar Control to visible when the field has the focus. However, I can't get rid of the Calendar Control now! I tried using the On Exit and On Lost Focus properties but I keep getting an error telling me I can't close an object that already has the focus. Hmmm. Any idea how I can close the Calendar Control object - i.e. when I click inside another field or when I click anywhere else on the form?

    Cheers for your help so far,

  4. #4

    Re: Calendar Control Problem

    Ok i think you need to do the following Cal( is my Calendor Contorl name)

    When you setup the Cal On_Click i am guessing it looks this

    Private Sub Cal_Click()
    DateField = Cal.Value

    This is to set the next FocusSeT
    End Sub

    And if that does Move your Focus to the Field you stated in <<Field>>
    Your next step will be to state <<Field>>_GotFocus

    Cal.Visable = False

    I think that will work.

    But i am new to this so it may not just guessing.

    If it works let me know

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: Calendar Control Problem

    Actually, you can do it all in the same event procedure.

    <pre>Private Sub Cal_Click()
    DateField = Cal.Value
    'set the focus to another control
    'once the focus has moved,
    'you can hide the calendar control
    Cal.Visible = False
    End Sub</pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts