Consulting

Results 1 to 2 of 2

Thread: Forward Selected dates to another UserForm

  1. #1

    Forward Selected dates to another UserForm

    Hi,

    On UserForm1 calendar picker where dates are selected and want to pass the selected date to another UserForm (Master) TextBox6 and TextBox7.

    In UserForm1
    Private Sub cmdOK_Click()
    'dFDay and dLDay are the two dates selected.
    
    If dFDay > 0 And dLDay > 0 Then
       Master.TextBox6 = dFDay
       Master.TextBox7 = dLDay
    End If
    End Sub
    How to send this dFDay to Master.TextBox6 & dLDay to Master.TextBox7 on pressing OK button exit the Userform1 and activate Master with selected dates in TextBox6 & 7.

    Thanks.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Try this
    Option Explicit
    
    Private Sub cmdOK_Click() 
         'dFDay and dLDay are the two dates selected.
         
        If dFDay > 0 And dLDay > 0 Then 
    Load Master 'Master is the actual name of the other UserForm
    'Load(UserForms("Master")) 'May be this syntax.
            Master.Controls("TextBox6") = dFDay 
    'UserForms("Master").Controls("TextBox6") = dFDay 
            Master.Controls("TextBox7") = dLDay 
    Master.Show
    Unload Me 'Me is ThisUserForm
    'Unload(Me)
        End If 
    End Sub
    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

Posting Permissions

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