sorry for that as i am new here :
Private Sub txtboxidnumber_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If txtboxidnumber.Value = True Then
Sheets("Database").Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
If (Selection.Find(What:=txtboxidnumber.Value, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False)) Is Nothing Then
txtdate.Value = ""
txtissues.Value = ""
MsgBox ("No Record Found")
Else
iRow = (Selection.Find(What:=txtboxidnumber.Value, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Row)
txtdate.Value = Range("B" & iRow).Value
Me.txtdate.Enabled = False
cmbOU.Value = Range("C" & iRow).Value
Me.cmbOU.Enabled = False
cmbclassification.Value = Range("D" & iRow).Value
Me.cmbclassification.Enabled = False
txtissues.Value = Range("E" & iRow).Value
Me.txtissues.Enabled = False
txtresolution.Value = Range("F" & iRow).Value
Me.txtresolution.Enabled = False
cmbactionby.Value = Range("G" & iRow).Value
Me.cmbactionby.Enabled = False
txtpriority.Value = Range("H" & iRow).Value
Me.txtpriority.Enabled = False
cmbstatus.Value = Range("I" & iRow).Value
Me.cmbstatus.Enabled = False
txtdateresolved.Value = Range("J" & iRow).Value
Me.txtdateresolved.Enabled = False
With UserForm2
txtboxidnumber.SetFocus
End With
End If
End If
End Sub
Bookmarks