Enigmus345
Board Regular
- Joined
- Sep 9, 2014
- Messages
- 97
Hi everyone,
I'm having some trouble recalling data from my sheet 2 database after txt1 on my user form is updated. I'm pretty sure it's something simple as I've used similiar code on a command button in the past. Here is my code:
I'm having some trouble recalling data from my sheet 2 database after txt1 on my user form is updated. I'm pretty sure it's something simple as I've used similiar code on a command button in the past. Here is my code:
Code:
Private Sub txt1_AfterUpdate()row_number = 0
Do
DoEvents
row_number = row_number + 1
id = Sheet2.Range("A" & row_number)
If id = txt1.Text Then
txt2 = Sheets("Sheet2").Range("b" & row_number)
txt4 = Sheets("Sheet2").Range("c" & row_number)
txt5 = Sheets("Sheet2").Range("d" & row_number)
End If
Loop Until id = ""
End Sub