T
tdmailbox
I have a function that runs to test to make sure data in the tax_id
form cell fits inside one of two input masks. The fuction works fine,
if I put in bad data the msgbox tells me. However the
Me.tax_id.Setfocus doest work. If I put in bad data and tab out of
the cell my setfocus seems to run before the tab and I end up out of
the cell. How can I fix this? I tried Cancel=True as someone
mentioned but that doesnt fix it.
Private Sub tax_id_AfterUpdate()
If Me.tax_id Like "###-##-####" Or Me.tax_id Like "##-#######" Then
' it looks OK
Else
MsgBox "Format Must be ##-####### for " & _
"EIN or ###-##-#### for SSN"
Cancel = True
Me.tax_id.SetFocus
End If
End Sub
form cell fits inside one of two input masks. The fuction works fine,
if I put in bad data the msgbox tells me. However the
Me.tax_id.Setfocus doest work. If I put in bad data and tab out of
the cell my setfocus seems to run before the tab and I end up out of
the cell. How can I fix this? I tried Cancel=True as someone
mentioned but that doesnt fix it.
Private Sub tax_id_AfterUpdate()
If Me.tax_id Like "###-##-####" Or Me.tax_id Like "##-#######" Then
' it looks OK
Else
MsgBox "Format Must be ##-####### for " & _
"EIN or ###-##-#### for SSN"
Cancel = True
Me.tax_id.SetFocus
End If
End Sub