Compile Error:Invalid use of property

Joined
Oct 6, 2011
Messages
1
Reaction score
0
I am trying to set up a data entry box for entering names and division. But it gives me an Compile error: Invalid use of property at the Clear controls "TextName.Text". I am very new at this so it may sound like a simple question. Thanks in advance!

Private Sub OKButton_Click()
' Make sure sheet one is active
Sheets("Sheet1").Activate

' Determine the next empty row
Dim NextRow As Long
NextRow = Application.WorksheetFunction.CountA(Range("A:A")) + 1
' Transfer the name
Cells(NextRow, 1) = TextName.Text

' Transfer the division
If OptionAdult Then Cells(NextRow, 2) = "Adult"
If OptionYouth Then Cells(NextRow, 2) = "Youth"
If OptionPeewee Then Cells(NextRow, 2) = "Unknown"

' Clear the controls for the next entry
TextName.Text ""
OptionPeewee = True
TextName.SetFocus
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top