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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set "Can Grow" Text box property up to specified size 1

Status
Not open for further replies.

mdlaugh1

Technical User
Jan 17, 2006
76
US
I have a report Text box which pulls from a Memo field in a table linked to Oracle. I want to limit the number of characters allowed to display in the field. I have the "Can Grow" property set to YES so it will pull a variable number of characters... but I would like to set an upper limit on the field to prevent one record having 200+ chars from expanding the report unnecessarily. thanks!
 
Either set the text box to the max height and don't allow it to grow or change the control source to something like:
=Left([Memo field in a table linked to Oracle])

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
hi dhookom,
I tried the =Left([Memo field in a table linked to Oracle]) code, but get #error now.

For Access to accept the statement I actually had to enter it with a ",n" argument as: =Left([Memo field in a table linked to Oracle],50)

but I still get the #error no matter what syntax I use. I would like to keep the box as "Can Grow" so not to take up large amount of space for short description records. thanks!
 
Sorry I forgot to mention the number argument for Left().

Did you change the name of the text box so that it is not also the name of a field from the report's record source? Try change the name to:
txtMemoFieldInATableLinkedToOracle

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Hi dhookom,
GREAT, changing the name of the text box did it. thanks!

In looking over my report (I often start with the Report Wizard, then add fields as needed) I deliberately make the text box name the same as the field name... bad practice?
 
I don't generally care what the name of a text box is unless I need to reference it in code or another control source. It would be nice if dragging a field to a report would result in a convention like "txtFieldName".

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
You're saying you don't care unless referencing in code or control source... so the fact that I attached code (=Left()) to the Task_Desc control box is what caused the #error? Basically if I do anything with a Control other than display it, then I need to be sure the Control name is not the same as the db field name? thanks!
 
You are correct. Keep in mind that if you reference a text box in another text box control source it looks very sloppy to have:

=Text23+(Text16-Text2)

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top