jpmccreary
New Member
- Joined
- Jul 21, 2010
- Messages
- 11
I am experiencing a strange issue with one of my forms. The form collects customer info from the user using a multi page interface. On the 2nd tab I have a text box called tbEffectiveDate and two frames: Tax and Signature info. Inside the tax frame I have text boxes for business type, incorporated and tax id/ssn. For tax and ssn I have code for exiting to check the length and also format the number entered:
Private Sub tbTaxID_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If IsNumeric(Val(tbTaxID.Value)) And Len(tbTaxID.Value) = 9 Then
tbTaxID.Text = Format(tbTaxID.Text, "00-0000000")
Else
MsgBox "Please enter a valid 9 digit tax id"
Cancel = True
End If
End Sub
When I exit tbTaxID this sub is not called. If I tab through all items and back around to the tbEffectiveDate this sub does get called after exiting, but only after tabbing through everything. I deleted the code for tbEffectiveDate but this still occurs. I also tried renaming the text boxes. How can these text boxes be linked with no code?If IsNumeric(Val(tbTaxID.Value)) And Len(tbTaxID.Value) = 9 Then
tbTaxID.Text = Format(tbTaxID.Text, "00-0000000")
Else
MsgBox "Please enter a valid 9 digit tax id"
Cancel = True
End If
End Sub