Solved Form - Data Entered Must Be Greater than 10 characters (1 Viewer)

Number11

Member
Local time
Today, 11:08
Joined
Jan 29, 2020
Messages
607
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:08
Joined
May 7, 2009
Messages
19,175
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
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:08
Joined
Sep 21, 2011
Messages
14,050
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

Top Bottom