Tell is string fits textbox

RECrerar

Registered User.
Local time
Yesterday, 22:06
Joined
Aug 7, 2008
Messages
130
Hi,

I'm sure I've seen this somewhere but can't find it now.

I would like to be able to tell if a string fits into a text box on a report and if it does not then cut it off at a length that does fit and append "..." to the end of the string.

Is it possible to tell if a string fits into the textbox?
 
You can get a rough idea by using LEN(textstring) to get the length of the string. This should give you an idea if it will fit or not.
 
Wont it depend on the character mix, a load of i s take up less space than a few Ms or Ws for example.

Brian
 
Wont it depend on the character mix, a load of i s take up less space than a few Ms or Ws for example.

Brian
Very true. It will depend on the exact character mix. That's why I said "A rough idea".
 
Yeah,

It's not perfect but to be honest it's only an inetrnal report so it doesn't really matter if it's perfect or not. I'm sure I saw somewhere a command that allowed to to check if the text fit the text box but maybe I dreamed that.

Do you think dreaming about my database is a sign of mental health issues?!

Anyway thanks, I will just use Len for now, that will work fine
 
Last edited:
It is always easier to see the solutions to other people's problems. You can be too close to see the bigger picture
 
That's probably true, Just read make my last post and dear lord my typing is bad.

Thanks again
 
That's probably true, Just read make my last post and dear lord my typing is bad.

Thanks again
I think that's a sign your brain is working faster than your fingers:D
 

Users who are viewing this thread

Back
Top Bottom