Hi All,
I need my cusor to focus on a particular column, if there is any error. I did write setfocus on that column. But the cursor would still go to the next column. Below is my code. Please tell me what is the mistake i have done here.
txtVEHICLE_ID = Trim$(txtVEHICLE_ID)
Set db = DBEngine.Workspaces(0).Databases(0)
Set rs = db.OpenRecordset("tblPermtrucks", DB_OPEN_DYNASET)
criteria = "VEHICLE_ID = '" & txtVEHICLE_ID & "'"
rs.FindFirst criteria
If rs.NoMatch Then
Exit Sub
Else
MsgBox "This vehicleid matches with another permanent truck id. Please use a different vehicleid"
txtVEHICLE_ID.SetFocus
db.Close
Exit Sub
End If
Thanks for any help,
Viji
I need my cusor to focus on a particular column, if there is any error. I did write setfocus on that column. But the cursor would still go to the next column. Below is my code. Please tell me what is the mistake i have done here.
txtVEHICLE_ID = Trim$(txtVEHICLE_ID)
Set db = DBEngine.Workspaces(0).Databases(0)
Set rs = db.OpenRecordset("tblPermtrucks", DB_OPEN_DYNASET)
criteria = "VEHICLE_ID = '" & txtVEHICLE_ID & "'"
rs.FindFirst criteria
If rs.NoMatch Then
Exit Sub
Else
MsgBox "This vehicleid matches with another permanent truck id. Please use a different vehicleid"
txtVEHICLE_ID.SetFocus
db.Close
Exit Sub
End If
Thanks for any help,
Viji