Private Sub txtpid_LostFocus() Dim flag As Boolean Do While 2 > 0 For i = 1 To rec.RecordCount If rec!pid = Val(txtpid.Text) Then MsgBox ("pid already exists,enter again") flag = True Exit For End If Next i If flag = True Then txtpid.SetFocus Else Exit Do endif Loop End Sub
Exit Do
End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)