compile error method or data member not found
error is at If Trim(Me.txtaddressrouter.Value)
win 7 excel 2007
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("sheet1")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtaddressrouter.Value) = "" Then
Me.txtaddressrouter.SetFocus
MsgBox "Please enter carrier name"""
Exit Sub
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txtstart.Value
ws.Cells(iRow, 2).Value = Me.Txtend.Value
ws.Cells(iRow, 3).Value = Me.txtpub.Value
'clear the data
Me.txtstart.Value = ""
Me.Txtend.Value = ""
Me.txtpub.Value = ""
Me.txtaddressrouter.SetFocus
End Sub
Private Sub cmdclose_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
error is at If Trim(Me.txtaddressrouter.Value)
win 7 excel 2007
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("sheet1")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtaddressrouter.Value) = "" Then
Me.txtaddressrouter.SetFocus
MsgBox "Please enter carrier name"""
Exit Sub
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txtstart.Value
ws.Cells(iRow, 2).Value = Me.Txtend.Value
ws.Cells(iRow, 3).Value = Me.txtpub.Value
'clear the data
Me.txtstart.Value = ""
Me.Txtend.Value = ""
Me.txtpub.Value = ""
Me.txtaddressrouter.SetFocus
End Sub
Private Sub cmdclose_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub