Consulting

Results 1 to 3 of 3

Thread: Userform - Compile Error: Invalid qualifier

  1. #1

    Userform - Compile Error: Invalid qualifier

    Hi all,

    New to VBA and Userforms and having trouble figuring out my first real one here.
    I get a "Compile Error: Invalid Qualifier" error whenever I click the OKButton - Always highlighting "Private Sub OKButton_Click()" after doing so.

    I am comparing it to a very similar code and simply cant figure out where I am going wrong, any help would be amazing!

    Private Sub OKButton_Click()

    Dim emptyRow As Long


    Sheet1.Activate


    emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1


    Cells(emptyRow, 2).Value = Name.Value
    Cells(emptyRow, 3).Value = XS.Value
    Cells(emptyRow, 5).Value = Description.Value
    Cells(emptyRow, 10).Value = Fault.Value
    Cells(emptyRow, 11).Value = ITC.Value
    Cells(emptyRow, 12).Value = Trigger.Value
    Cells(emptyRow, 13).Value = Why.Value
    Cells(emptyRow, 20).Value = Await.Value


    If Waive.Value = True Then Cells(emptyRow, 4).Value = "Waived"


    If CheckBox2.Value = True Then Cells(emptyRow, 5).Value = "Claim Number"


    If CheckBox3.Value = True Then Cells(emptyRow, 6).Value = "Assessment Process"


    If CheckBox4.Value = True Then Cells(emptyRow, 7).Value = "Discussed Hire Car benefit"


    If CheckBox5.Value = True Then Cells(emptyRow, 21).Value = "Discussed No Hire Car benefit"


    If CheckBox6.Value = True Then Cells(emptyRow, 8).Value = "ePam Spun"


    If CheckBox7.Value = True Then Cells(emptyRow, 9).Value = "SMS Sent"


    If OK2P.Value = True Then Cells(emptyRow, 14).Value = "OK2P"


    If CheckBox9.Value = True Then Cells(emptyRow, 15).Value = "OC Assessment"


    If CheckBox10.Value = True Then Cells(emptyRow, 16).Value = "TP approach"


    If CheckBox11.Value = True Then Cells(emptyRow, 17).Value = "TP Recovery"


    If CheckBox12.Value = True Then Cells(emptyRow, 18).Value = "Hire Car Invoice"


    If CheckBox13.Value = True Then Cells(emptyRow, 19).Value = "Tow Invoice"


    If OKOption.Value = True Then
    Cells(emptyRow, 1).Value = "OK"
    Else
    Cells(emptyRow, 1).Value = "WOP"
    End If




    End Sub

  2. #2
    Knowledge Base Approver VBAX Guru
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    4,784
    When you get the yellow highlight, do you also get a blue highlight like:
    2019-12-10_110557.jpg
    If so, check the control exists on the userform or that it's spelt correctly.

    Otherwise attach the workbook here.
    p45cal - - - - -This is my signature, it appears after all my posts. Below is not directed at anyone in particular - so don't take offence! - (You might guess why it's there though)
    If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    Thankyou! I hadn't even noticed that blue hightlight.

    "Name" matched the name of the text box i was trying to link it to. But I just renamed the textbox to something else and updated the .Value area and presto!
    Works perfectly!

    Thanks for your help! I really appreciate it.

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
  •