On my cmdSaveRecord, I check a couple of fields to confirm that an entry has
been made before allowing the Save.
I decided to
- not put validation rules in table structure, and
- validate on Save
to avoid annoying the user if a field was left empty before clicking
cmdSaveRecord
For each field validated in this way, I was getting an error something like
"...does not have the focus ..." until I added
Me.txtBox.SetFocus
before this code
If Len(Me.txtBox.text) = 0 Then
MsgBox "Field Must Have A Value", ...
Exit Sub
End If
The SetFocus technique requires that the cmdSaveRecord be clicked once for
each field tested this way ... not very user-friendly.
Is there a way to avoid this use SetFocus? If it isn't really required,
please tell me what I might be doing wrong.
Thanks for any help.
Larry Mehl
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.562 / Virus Database: 354 - Release Date: 1/16/2004