Greetings!
I ve written the below snippet:
It should read an employee's id from txtArel textbox (which works fine) and write his surname in textbox txtSur. Instead it gives me error '9' subscript out of range.
is yellowed.
Thanks in advance!
I ve written the below snippet:
Code:
If IsNumeric(FillingForm.txtArel.Value) Then
flag = False
i = 2
j = 2
id = FillingForm.txtArel.Value
Do While Cells(i, 1).Value <> ""
If Cells(i, 1).Value = id Then
flag = True
Set FillingForm.txtSur.Value = Worksheets("mainDB").Cells(i, j + 1).Value
End If
i = i + 1
Loop
End If
End Sub
It should read an employee's id from txtArel textbox (which works fine) and write his surname in textbox txtSur. Instead it gives me error '9' subscript out of range.
Code:
Set FillingForm.txtSur.Value = Worksheets("mainDB").Cells(i, j + 1).Value
Thanks in advance!