Consulting

Results 1 to 2 of 2

Thread: Calender Control

  1. #1

    Calender Control

    I have two userforms that I want to call the calendar control. Currently I have a calendar control for each userform. Is it possible to have only 1-calendar control being used by 2-userformsl?

    Private Sub Calendar1_Click()
        frmLogbook.txtDate = Calendar1.Value
     
        frmFlt.txtDate = Calendar1.Value
        Unload Me
    End Sub
    Private Sub cmdClose_Click()
        Unload Me
    End Sub
    Private Sub UserForm_Initialize()
        Calendar1.Value = DateValue(frmLogbook.txtDate.Value)
     
        Calendar1.Value = DateValue(frmFlt.txtDate.Value)
     
    End Sub

  2. #2
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    The only way I can see to do it is if both userforms are open when you click the calendar. Otherwise you will have to store the date in a global variable or a range on the sheet for the other userform to retrieve.

    Someone else might have an idea.

    Any time I see someone dealing with calendar controls I always point them to this thread......it's worth your time to read, especially from post #7 on.

    http://www.vbaexpress.com/forum/showthread.php?t=10914
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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