Results 1 to 21 of 21

VB Code to Call Userform in Userform

Threaded View

  1. #1
    Registered User
    Join Date
    03-21-2012
    Location
    Metro Manila, Phiippines
    MS-Off Ver
    Office 2007
    Posts
    77

    VB Code to Call Userform in Userform

    Greetings!

    Hello, I wonder if what code should I use to call another userform inside a userform. It keeps prompting me an error when I tried to insert a userform.show in a click event. here is the example.

    this is the code to call the main userform

    Private Sub CommandButton4_Click()
        frmSRStat.Show
    End Sub
    then this userform will appear.

    Attachment 146862

    here is the code for this main userform

    Private Sub cmdClose_Click()
        Unload Me
    End Sub
    
    Private Sub cmdSelect_Click()
    Sheets("Group SR").Range("N1") = ComboBox1.Value
    If ComboBox1.Value = "ALL STATUS" Then
    Sheets("Group SR").Range("N1") = ""
    End If
    Unload Me
    End Sub
    
    Private Sub Image1_Click()
    frmCalendar.Show
    End Sub
    
    Private Sub TextBox1_Change()
    Calendar1.Value
    End Sub
    
    Private Sub UserForm_Initialize()
    With ComboBox1
        .Value = "ALL STATUS"
        .AddItem "ALL STATUS"
        .AddItem "ACTIVATED-CONFIRMED"
        .AddItem "ACTIVATED-QA"
        .AddItem "ESCALATED NPSD SOC BRO"
        .AddItem "ESCALATED NPSD SOC BRO - PREMIUM"
        .AddItem "ESCALATED_NPSD_CRG"
        .AddItem "ESCALATED-KSP"
        .AddItem "FEEDBACK"
        .AddItem "FOR_DEPLOYMENT"
        .AddItem "FOR_RESCHEDULING"
        .AddItem "OPEN"
        .AddItem "SCHEDULED-RESCHEDULED"
    End With
    End Sub
    then in escalation date field. i will click the small calendar image so that the second userform will appear. but upon clicking, it will prompt me an error that says object required.

    Attachment 146861

    i tried to insert the line frmCalendar.Show(name of the second userform) in Private Sub Image1_Click() event then the error now prompts. I don't know how to call the second userform inside the main userform.
    Last edited by Stonesteel15; 03-22-2012 at 04:29 AM.
    "Consummatum Est"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1