Solved Form - Data Entered Must Be Greater than 10 characters

Number11

Member
Local time
Today, 01:04
Joined
Jan 29, 2020
Messages
623
Is it possible to have on a form something that will prompt the user entering if the number of characters within a field is less than 10, is so then pop a message to say
 
use BeforeUpdate Event of the Textbox;
Code:
Private Sub textbox1_BeforeUpdate(Cancel As Integer)
Dim i As Integer
i = Len(Me!textbox1 & "")
If  i <> 0 Then
    Cancel = i < 10
End if
If Cancel Then
    Msgbox "Minimum length of string should be 10 characters!"
End If
End Sub
 
Is it possible to have on a form something that will prompt the user entering if the number of characters within a field is less than 10, is so then pop a message to say
Check its length with Len() ?
 

Users who are viewing this thread

Back
Top Bottom