How to add validation to TextBox (1 Viewer)

SachAccess

Active member
Local time
Tomorrow, 03:41
Joined
Nov 22, 2021
Messages
389
Hi,
I have few Forms in my DB. There are few TextBoxes in my DB.
User needs to give his input in these input box.

How do I add validation to these Textboxes. For example, one textbox requires user to input mobile number.
It has to be 10 digit, however at present Textbox takes any value, be it text, number or number of any length.

How can add validation here, I tried validation option in properties of textbox but was not able to understand it.
Can anyone please help me in this. Thanks.
 

onur_can

Active member
Local time
Today, 15:11
Joined
Oct 4, 2015
Messages
180
Hi,
if you want validation for phone number textbox you can try input mask method of textbox.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:11
Joined
Feb 19, 2013
Messages
16,612
Or put something like this in the validation property

len(myfield)=10 and isnumeric(myfield)
 

SachAccess

Active member
Local time
Tomorrow, 03:41
Joined
Nov 22, 2021
Messages
389
Thanks a lot for the help @CJ_London sir, have a nice day ahead. :)
PS - not aware of your time zone hence day. :)


PS - Sir it seems am doing something wrong with this. 'Like "??????????"' is working for me at present but somehow am doing mistake while entering your code, changed 'myfield' to textbox name but still same issues. Will revert with details. Thanks.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:11
Joined
Feb 19, 2013
Messages
16,612
'Like "??????????"' is working for me at present

if that is working for you I would use that - it's simpler than my suggestion anyway....
 

Users who are viewing this thread

Top Bottom