Solved How to setup conditional formatting on a form (1 Viewer)

Number11

Member
Local time
Today, 22:39
Joined
Jan 29, 2020
Messages
607
I am looking for a way to have the form highlight any names that greater than in characters

First Name <20
Surname <30

any pointers please?
 

Cotswold

Active member
Local time
Today, 22:39
Joined
Dec 31, 2020
Messages
528
I'll just add that if you haven't saved the Fields in the Table using Trim() or by some other method, then Len() will not do that for you

XX = "ASDFGH" + Space(6) So, Len(XX) will give you 12, not maybe the 6 it looks like.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:39
Joined
Feb 19, 2002
Messages
43,301
Is there some reason you don't want to let the database engine enforce the length rule? Open the table in design view in the BE and set the length to whatever you want the max to be.

Also, for names (and most every other text field, I set AllowZeroLengthString to No. This prevents a zero length string from being saved. This is especially important if the text field is required. If the field is required, you absolutely want AllowZeroLengString to be No.
 

Users who are viewing this thread

Top Bottom