MS Access Question

In a report, how do I make a Textbox expand and contract according to the number of characters in it? I’ve tried setting “Can Expand” and “Can Shrink” in the properties box and it expands downward instead of to the right. For example, in the CITY STATE ZIP area I need the “city” box to expand or shrink according to the number of characters in the name of the city.
Can this be done?

It can probably be done through some rather complex Visual Basic programming but I don’t think there is an easy way through normal settings. If you are willing to do something complicated then let us know, otherwise, I think that living with a downward rather than rightward expansion is your best bet.

Well, there might be a short cut. Is the reason you want to do this so that it will look like

Salem, OR 97302

instead of

Salem , OR 97302?

If so, use a single text box for all three instead of one for City, one for State, and one for ZIP. The entry for ControlSource looks like

[City] & ", " & [State] & " " & [Zip]

Make sense? You can use the same kind of thing for other entries, like FirstName and LastName.

Thanks for your help. I’m using a report to write a boilerplate form letter with whatever inserted at the appropriate places. Such a great program as Access should have this feature. Oh well…

Jake, do you have Word as well as Access? The Mail Merge feature in Word allows you to create form letters that get their data from an Access database.

JayLa, I do have word and this might be the solution to my problem. I’ll give it a try!

Thanks.

The standard text box cannot expand itself based on content. You can do it through VBA programming, if you are using a fixed font size. Just calculate the number of lines by counting vbCrLf’s, and adjust the box to match.