VERY beginner question.

Discussion in 'Code Snippets and Tutorials' started by Balthier, Dec 28, 2006.

  1. Balthier

    Balthier Level III

    Joined:
    Dec 23, 2006
    Messages:
    552
    Likes Received:
    1
    Location:
    Louisiana
    Alright, i'm going through my first ever tutorial and i've done everything correctly, even by example. But, I keep getting a highlighted debug line (or whatever, lol) and I can't figure out what's wrong.

    Code (Text):
    1. Private Sub cmdClear_Click()
    2.     txtHello.txt = ""
    3.     End Sub
    4.  
    5. Private Sub cmdExit_Click()
    6.     End
    7. End Sub
    8.  
    9. Private Sub cmdHello_Click()
    10.     txtHello.Text = "Hello World!"
    11.     With txtHello
    12.         .Font = "Verdana"
    13.         .FontSize = 16
    14.         .ForeColor = vbBlue
    15.     End With
    16. End Sub
    17.  
    It highlights txtHello.Text = "Hello World!" with the error, "Run-time error='424'

    Object Required"

    What am I doing wrong?
     
  2. expon

    expon Administrator
    Staff Member

    Joined:
    Oct 30, 2006
    Messages:
    1,393
    Likes Received:
    56
    Location:
    UK
    Are you sure your textbox Name property is set to txtHello?
    I don't think theres anything wrong with the code except under cmdClear it should be txtHello.Text not txtHello.txt
     
  3. kane

    kane Newbie

    Joined:
    Jan 14, 2007
    Messages:
    6
    Likes Received:
    0
    Like what ^^ he said "Object required" means you have called something off the form which isnt there. Check the spelling >.>