I am implementing this to make sure that people do not enter to many characters
As my field is big I want to show the user how many characters they can enter so I thought this would work but it does not.
Could someone please assist.
Code:
Private Sub mytextbox_BeforeUpdate(Cancel As Integer)
If Len(Me.mytextbox) > 1000 Then
MsgBox "Too big"
Cancel = True
End If
End Sub
Code:
Private Sub txt_comments_BeforeUpdate(Cancel As Integer)
If Len(Nz(Me.txt_comments)) > 1000 Then
Cancel = True
MsgBox "too big"
Me.txt_comments.Value = Left(Me.txt_comments, 1000)
End If
End Sub
Could someone please assist.