This is the troubled bit of code:
Private Sub txtFName_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim intAns As Integer
Dim strFirstName As String
strFirstName = txtFName
intAns = MsgBox("Is This name:" & vbCr & _
strFirstName & vbCr & _
" correct?", vbQuestion + vbYesNo, "Final Answer?")
If intAns = vbYes Then
txtLName.SetFocus 'make the next (Last Name) text box the active
text box
Else
txtFName.SetFocus 'make the First Name text box active again
End If
End Sub
Thanks for your help.
JMMach
If intAns = vbYes Then
txtLName.SetFocus
Cancel = False
Else
txtFName.SetFocus
Cancel = True
End If
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com ch...@cpearson.com
"JMMach" <jmm...@gto.net> wrote in message
news:Ow5sTh95...@TK2MSFTNGP11.phx.gbl...
"Chip Pearson" <ch...@cpearson.com> wrote in message
news:O9ckap95...@TK2MSFTNGP09.phx.gbl...
The Cancel parameter allows you to override VBA's default behavior.
When you set Cancel = True, you are telling VBA to cancel the exit
of the control and leave focus on that control.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com ch...@cpearson.com
"JMMach" <jmm...@gto.net> wrote in message
news:Oq23G#95CHA...@TK2MSFTNGP12.phx.gbl...
"Chip Pearson" <ch...@cpearson.com> wrote in message
news:O4VpcM#5CHA...@TK2MSFTNGP12.phx.gbl...