i always get this error when i try to run...does anyone know what's the problem

Code Snippet

Option Explicit

Private Sub UserForm_Initialize()
cbxDept.AddItem "Marketing & Sales"
cbxDept.AddItem "Supply Chain"
cbxDept.AddItem "Purchasing"
cbxDept.AddItem "Technical & Production"
cbxDept.AddItem "Research & Development"
cbxDept.AddItem "Finance & Control"
cbxDept.AddItem "Human Resource"
cbxDept.AddItem "Globe & ISIT Services"
End Sub

Private Sub cmdPrevious_Click()
If txtRow.Text > 1 Then txtRow.Velue = txtRow.Value - 1
End Sub

Private Sub cmdNext_Click()
If txtRow.Text < Range("Database").Rows.Count Then txtRow.Value = txtRow.Value + 1
End Sub

Private Sub txtFName_AfterUpdate()
Range("A2")(txtRow.Text).Value = txtFName.Value
End Sub

Private Sub txtLName_AfterUpdate()
Range("B2")(txtRow.Text).Value = txtLastName.Value
End Sub

Private Sub cbxDept_AfterUpdate()
Range("C2")(txtRow.Text).Value = cbxDept.Value
End Sub

Private Sub txtRow_AfterUpdate()
If txtRow.Text < 1 Then
txtRow.Text = 1
ElseIf txtRow.Text > Range("Database").Rows.Count Then
txtRow.Text = Range("Database").Rows.Count
End If
End Sub

Private Sub UpdateData()
txtFName.Text = Range("A2")(txtRow.Text).Value
txtLName.Text = Range("B2")(txtRow.Text).Value
cbxDept.DropButtonStyle = Range("C2")(txtRow.Text).Value
End Sub


Re: Run-time error '13': Type Mismatch

Andy Pope


You do not say exactly where the were the error occurs.
But first guess would be that txtRow.text does not contain a valid value when used in the UpdateData routine.

Re: Run-time error '13': Type Mismatch


hi Andy, thank you for replying, you can ignore my post since now i use a different method to do this project, sorry to trouble you

thanx a lot