Solved How to setup conditional formatting on a form

Number11

Member
Local time
Today, 16:07
Joined
Jan 29, 2020
Messages
623
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?
 
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.
 
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

Back
Top Bottom