Caption size (1 Viewer)

kirkm

Registered User.
Local time
Tomorrow, 10:48
Joined
Oct 30, 2008
Messages
1,083
I read in the MS documentation The Caption property is a string expression that can contain up to 2,048 characters. Captions for forms and reports that are too long to display in the title bar are truncated.
Why do they talk nonsense? My Form caption is not too long, but is truncated.
Or, is there a setting to ensure it is not truncated?
Thanks
 

moke123

AWF VIP
Local time
Today, 16:48
Joined
Jan 11, 2013
Messages
2,239
I just tested and could use 128 characters in a form caption.
How long is your caption? Do use use any special characters?
 

Micron

AWF VIP
Local time
Today, 16:48
Joined
Oct 20, 2018
Messages
3,471
Why is that nonsense? Does your caption perhaps contain hidden/special characters that you are not aware of? Is your form too narrow to show the number of characters in the caption? You haven't provided much in the way of evidence or information.
 

kirkm

Registered User.
Local time
Tomorrow, 10:48
Joined
Oct 30, 2008
Messages
1,083
It's nonsense as the limit is not 2048. Max length shown here is also 128 chars. Is yours different?
There's no special or hidden characters. What alerted me to the problem was the unfilled space in the Form caption area, and the text being cut off.
The text is:
"DJ Jazzy Jeff & The Fresh Prince - Girls Ain't Nothing But Trouble (Laidley & Oakenfold Remix) b/w Guys Ain't Nothing But Trouble"
and the last "Trouble" becomes "Trou"
 

moke123

AWF VIP
Local time
Today, 16:48
Joined
Jan 11, 2013
Messages
2,239
The caption property can hold more than 128 characters, it just cant display it on the form.
 

Micron

AWF VIP
Local time
Today, 16:48
Joined
Oct 20, 2018
Messages
3,471
The caption property can hold more than 128 characters, it just cant display it on the form.
Didn't know that and seems kind of pointless to set a value for something that is visual to be higher than what you can see. However, it seems that a label will display the string that was posted. Often I type a single space in the form caption property just to get rid of a form caption so I'm sort of intrigued by the desire to post such a lengthy string in a form caption. The work around seems to be to use a label instead.

And yes, mine seems to be different. When repeatedly copying and pasting an 11 character string into the form caption property, I could only see 91.
 

moke123

AWF VIP
Local time
Today, 16:48
Joined
Jan 11, 2013
Messages
2,239
Didn't know that and seems kind of pointless to set a value for something that is visual to be higher than what you can see.
Another strange one is listboxes and comboboxes. You can set their value in code to a value not contained in their rowsources.
 

Micron

AWF VIP
Local time
Today, 16:48
Joined
Oct 20, 2018
Messages
3,471
I don't find that so odd, at least not for combos. Combos can use the NotInList event to handle value inputs where the value doesn't exist in the list - assuming you want to add it, which is a common occurrence I'd say. It needs to be that way to allow new unique values in table fields when the control is bound. As for the listbox, it has the AddItem method (if the rowsource property is Value List) for the same reason I guess.
 

moke123

AWF VIP
Local time
Today, 16:48
Joined
Jan 11, 2013
Messages
2,239
I don't find that so odd, at least not for combos. Combos can use the NotInList event to handle value inputs where the value doesn't exist in the list - assuming you want to add it, which is a common occurrence I'd say. It needs to be that way to allow new unique values in table fields when the control is bound. As for the listbox, it has the AddItem method (if the rowsource property is Value List) for the same reason I guess.
What I meant is that you can set its value without the new value appearing in the list, not using additem,etc. The datatype need not be the same. Whether it is bound makes no difference either. With a combo the value will appear but the not in list wont fire.
 

Users who are viewing this thread

Top Bottom