Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want first 31 characters in a Form field 3

Status
Not open for further replies.

cimoli

Technical User
Jul 30, 2010
207
US
I have a company field on a form. I would like to limit the form to show just the first 31 characters and not wrap around.
Is this possible?
 
if you are only displaying and not entering then you can set the control source to
=left([yourFieldName],31)
 
Hi. Yes, i tried before in the Form on the Control Source line and got .... #Type!

Unless you see my obvious error somewhere, for now, i went back to the query.
and changed the real Account field to be named in the Qry, Company with the following field line.

Company: Left([AccountName],31)

and went to the form and changed the Account field control source in the form to read Company.

So I am good. But if you know why i got that #Type! i could change it back.

thanks
 
why i got that #Type
I'd try this:
=Left([yourFieldName][!] & ""[/!],31)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes, that did it. I put your new code into the form field and it works great.
thanks so much.
 
PHV, what does adding a Null String to the end do to the value? At first I thought you were adding quotes, but no, it's a NULL String. Is it a quirk that we have to sometimes work around, or is there something there that makes sense that I just have missed.

Thanks

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Adding a zero length string coerces the expression to type string and prevents side effects with Null values.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top