Consulting

Results 1 to 8 of 8

Thread: 424 Error, but object is in place

  1. #1
    VBAX Newbie
    Joined
    Aug 2016
    Posts
    4
    Location

    424 Error, but object is in place

    Hi guys,

    I'm pretty new to VBA but learning quickly. BUT, I have an error and can't seem to find out what's going wrong.

    I have my button, with the following macro:

    Sub NewRoute55_Click()
    
    
    AddRoute55.Show
    
    
    End Sub
    Which should show the said AddRoute55 form. Except it doesn't. The form is named AddRoute55, so that should match up. The form has the following code:

    Private Sub UserForm_Initialize()
    
    
    'Empty Status
    StatusBox.Clear
    
    
    'Fill StatusBox
    With StatusBox
        .AddItem "Received"
        .AddItem "Returned to PM"
        .AddItem "In Progress"
        .AddItem "On Hold"
        .AddItem "Complete"
        .AddItem "Closed"
        .AddItem "RFC"
    End With
    
    
    
    
    'Empty BTBox
    BTBox.Clear
    
    
    'Fill BTBox
    With BTBox
        .AddItem "Run"
        .AddItem "Change"
    End With
    
    
    'Empty DomainBox
    DomainBox.Clear
    
    
    'Fill DomainBox
    With DomainBox
        .AddItem "AMS NL"
        .AddItem "AMS INT"
        .AddItem "EUS"
        .AddItem "IPS"
        .AddItem "NGC"
        .AddItem "Office"
        .AddItem "SM"
    End With
    
    
    'Empty AIMSBox
    AIMSBox.Value = ""
    
    
    'Empty ProjectCoedeBox
    ProjectCodeBox.Value = ""
    
    
    'Empty PMBox
    PMBox.Value = ""
    
    
    'Empty POBox
    POBox.Value = ""
    
    
    'Empty VendorBox
    VendorBox.Value = ""
    
    
    'Set No FTR as default
    FTRButton2.Value = True
    
    
    'Empty OrderReceivedBox
    OrderReceivedBox.Value = ""
    
    
    'Empty OrderProcessedBox
    OrderProcessedBox.Value = ""
    
    
    'Empty SSDMBox
    SSDMBox.Value = ""
    
    
    'Empty P2PBox
    P2PBox.Value = ""
    
    
    'Empty CustomerBox
    CustomerBox.Value = ""
    
    
    'Empty PMABox
    PMABox.Value = ""
    
    
    'Empty SPBox
    SPBox.Value = ""
    
    
    
    
    End Sub
    If you like more info or this helps out, you can download the file from my personal website, but I can't post links yet

    Please help me understand what I'm doing wrong here.

    Thanks in advance!

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Click the Go Advanced button. Below the reply text box you will see the Attachments section and a Manage Attachments button. You can upload your file here.

  3. #3
    VBAX Newbie
    Joined
    Aug 2016
    Posts
    4
    Location
    Workorder Dashboard vTEST.xlsm

    Thanks for that! Here is the file

  4. #4
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Quote Originally Posted by Snaad View Post

    Which should show the said AddRoute55 form. Except it doesn't. The form is named AddRoute55, so that should match up. The form has the following code:

    Private Sub UserForm_Initialize()
    
    
    '...code...
    
    'Empty ProjectCoedeBox
    ProjectCodeBox.Value = ""
    
    '...code...
    
    End Sub
    Please help me understand what I'm doing wrong here.

    Thanks in advance!
    You did an OOPSIE...

    You have a text box named ProjectNameBox. I don't see a control named ProjectCodeBox, so I'll bet that is the issue.

    In regards to finding the error, press the Debug button instead of quitting. Then slowly press F8 until you get to where the missing object becomes apparent.

    To avoid the error in the first place, when typing the control names in, qualify (preface) them with the Me keyword and a stop (period). You will see that upon typing the stop, all of the userform's properties are displayed, including your controls. Makes it a lot harder to misspell or refer to a non-existent control

    Hope that helps,

    Mark

  5. #5
    VBAX Newbie
    Joined
    Aug 2016
    Posts
    4
    Location
    Damn, that puts me to place Feel a little stupid now. Thanks man, you've helped me so much!! And thanks for the secondary tips

  6. #6
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    You are most welcome and thank you for the feedback. Trust me, I make much bigger mistakes and stare until I am nearly drooling in a coma-like state sometimes, just not seeing the forest for the trees.

    BTW, I missed seeing that you just joined, so a big WELCOME to VBAExpress

    Mark

  7. #7
    VBAX Newbie
    Joined
    Aug 2016
    Posts
    4
    Location
    Quote Originally Posted by GTO View Post
    You are most welcome and thank you for the feedback. Trust me, I make much bigger mistakes and stare until I am nearly drooling in a coma-like state sometimes, just not seeing the forest for the trees.

    BTW, I missed seeing that you just joined, so a big WELCOME to VBAExpress

    Mark
    Thank you! I'll probably be a regular here if it keeps going this way, ha!

    Thanks again for the help!

    Sander

  8. #8

Tags for this Thread

Posting Permissions

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