Consulting

Results 1 to 3 of 3

Thread: Send Data to Alternate Userform

  1. #1
    VBAX Contributor
    Joined
    Aug 2011
    Posts
    126
    Location

    Send Data to Alternate Userform

    Because Office 365 Excel does not support frmCalendar, I've customized a Month Calendar on a Userform when called.
    I need to call the Month Calendar Userform from Multiple Userforms.
    The difficulty is identifying the Textbox where I wish the Date to be placed on the given userform that calls for the Month Calendar to Show.

    I've placed a textbox on the Calendar Form that populates with the Calling Userform Name and Textbox Name, but the Month Calendar does not recognize the string.

    What would be the appropriate Dim to set the Calendar form Textbox.value?

    Private Sub MonthCalendar_Click()
    
    MonthCalendar.DateDestination.Value = "Userform1.DatePicker"
    
    MonthCalendar.Show
    
    end sub
    
    Private Sub SendDate_Click()
    
    Dim a as ?
    a = Me.DateDestination.Value
    
    a.value = Me.Month.Value & "/" & Me.Day.Value & "/" & Me.Year.Value
    
    unload me
    
    end sub
    As Always.. Assistance is Greatly Appreciated !

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Can you add some detail to the verbal description above?

    Consider this example of Custom Object Properties.

    FrmCalendar code
    Dim fDate as Date
    
    Public Property Get Date() As Date
       Date = fDate
    End Property
    
    Public Property Let Date(Date As Date)
       fDate = Date
    End Property
    
    Private Sub DatePicker_Click()
    'Or whatever control is actually picking/setting the date to output to other forms.
    fDate = 'Date picked
    End Sub
    To Pick a date in frmCalendar, use a code style like Sub DatePicker_Click

    For a different UF to get a date from frmCalander
    NewDate = frmCalendar.Date
    For a different UF to assign a Date to frmCalendar
    frmCalendar.Date = NewDate
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Contributor
    Joined
    Aug 2011
    Posts
    126
    Location
    Many Thanks Sam !

    A little Nudge is all I needed.


Posting Permissions

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