Based on a combo box choice (state/province), I am changing a zip-code textbox input mask to either reflect an American zip code, or a Canadian zip code. It does the job, however it does not show the "_" where characters are required unless I start typing or I click out of the textbox and then click back in. Then the mask appears.
Is there a way to "reload" the text box after changing the input mask or something so that the mask appears when entered?
Current Code:
Code:
Private Sub liststate_Exit(Cancel As Integer)Dim rs As Recordset
If Nz(Me.liststate, "") <> "" Then
Set rs = CurrentDb.OpenRecordset("SELECT [States].* FROM [States] WHERE((([States].State)='" & Me.liststate & "'));")
With rs
If .RecordCount > 0 Then
If .Fields("Country") = "USA" Then
Me.txtzip.InputMask = "00000\-9999;;_"
ElseIf .Fields("Country") = "Canada" Then
Me.txtzip.InputMask = "!>L0L 0L0;;"
End If
Else
MsgBox "Error"
End If
.Close
End With
Else
Me.txtzip.InputMask = ""
End If
If Not rs Is Nothing Then
Set rs = Nothing
End If
End Sub
I am just finding that regardless of changing the input mask or not, while tabbing in, it doesn't show the placeholders.