this is my code
Private Sub Command1_Click()
If text1.Text = "" Or text2.Text = "" or text3.Text="" Then
MsgBox "All fields required", vbCritical, "Sorry"
If text1.Text = "" Then text1.SetFocus
Exit Sub
If text2.Text = "" Then text2.SetFocus
Exit Sub
If text3.Text = "" Then text3.SetFocus
Exit Sub
Else
With rscustomer
.AddNew
.Fields(0) = Label6.Caption
.Fields(1) = text1.Text
.Fields(2) = text2.Text
.Fields(3) = text3.Text
.Fields(4) = Label7.Caption
.Update
MsgBox "New record save!", vbInformation, "Save Record"
text1.Text = ""
text2.Text = ""
text3.Text = ""
Label6.Caption = rscustomer.RecordCount + 1
End With
End If
my problem is when text2 or text3 is blank,
it doesn't focus on the corresponding textbox
hope someone can help me, thank you

New Topic/Question
Reply



MultiQuote





|