I need help with my visual basic. Please.
I have a form that I want to restrict to only put a certain type of data in to the fields. And if that input mask is not correct to delete whatever has been put in that field and keep the focus at that field. The only way to go to the next field or even see data in the field is that if the correct data that matches the input mask has been entered.
This is what I have so far, but it doesn’t work.
Thanks in advance
I have a form that I want to restrict to only put a certain type of data in to the fields. And if that input mask is not correct to delete whatever has been put in that field and keep the focus at that field. The only way to go to the next field or even see data in the field is that if the correct data that matches the input mask has been entered.
This is what I have so far, but it doesn’t work.
Code:
Private Sub Cabinet_S_N_BeforeUpdate(Cancel As Integer)
If Me![Cabinet S/N].InputMask <> "000L0009" Then
Cancel = True
Me![Cabinet S/N].Undo
End If
End Sub
Thanks in advance