Ive been assigned with a assignment for Uni to create a system in excel.

Im currently stuck on creating the user form using the submit button. Ive used a tutorial to create the form and the code, but it doesnt work i get a subscript out of range error 9)

Here is what i have
[VBA]
Private Sub addpatient_Click()

Dim RowCount As Long
Dim ctl As Control
' Check user input
If Me.txtfirstname.Value = "" Then
MsgBox "Please enter a First Name.", vbExclamation, "Patients "
Me.txtfirstname.SetFocus
Exit Sub
End If
If Me.txtlastname.Value = "" Then
MsgBox "Please enter a Last Name.", vbExclamation, "Patients"
Me.txtfirstname.SetFocus
Exit Sub
End If
If Me.txtaddress.Value = "" Then
MsgBox "Please enter an address.", vbExclamation, "Patients"
Me.txtfirstname.SetFocus
Exit Sub
End If
If Me.txtDOB.Value = "" Then
MsgBox "Please enter a Date.", vbExclamation, "Patients"
Me.txtfirstname.SetFocus
Exit Sub
End If

' Write data to worksheet
RowCount = Worksheets("Sheet3").Range("A7").CurrentRegion.Rows.Count
With Worksheets("Sheet3").Range("A7")
.Offset(RowCount, 0).Value = Me.txtfirstname.Value
.Offset(RowCount, 1).Value = Me.txtlastname.Value
.Offset(RowCount, 2).Value = Me.txtaddress.Value
.Offset(RowCount, 3).Value = DateValue(Me.txtDOB.Value)
.Offset(RowCount, 4).Value = Me.txtprevnotes.Value

End With
' Clear the form
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Or TypeName(ctl) = "ComboBox" Then
ctl.Value = ""
ElseIf TypeName(ctl) = "CheckBox" Then
ctl.Value = False
End If
Next ctl
End Sub
[/VBA]

Any ideas, it highlights the "Sheet 3" bit but ive changed it the other name too with the same error.

I also have another error on another form saying Method or data member not found

No idea what they mean, ive searched all of the internet with no help, im hoping for some help here.

Thanks in advance

Edit: VBA tags added to code. Poster, use the vba button to surround your code instead of the quote or code button.