Test for long memo field in text box?

jimbrooking

Registered User.
Local time
Today, 16:19
Joined
Apr 28, 2001
Messages
210
I have a form with a text box whose recordsource is a memo-type field. I have a buch of stuff on the form that precludes a significant part of the form being "taken over" by this field. I have sized the field to accommodate probably 90% of the records, but a few of them overflow the field.

A user opening the form on one of these "long" fields will see the text truncated unless s/he moves the focus to the field, e.g., by clicking on it, at which time a vertical scroll bar will appear.

I hate to automatically send the focus to this control every time the form is opened, but I'd like to be able to clue the user that there's more text available if s/he wants to see it.

Does anyone know of a way to determine programmatically if text overflows its allocated text box size? With this, I could make visible a little "more..." indicator near the bottom of the box.

TIA,
Jim
 
The way I'm thinking and it may seem sloppy BUT...

If the textbox is a static size, then find out how many characters it will accommodate, then if the len(field)>maxtextvalue, show your more... button.

Make sense?

HTH
Charity
 
Charity-

Makes good sense in a fixed-pitch font world. But a given size box will accommodate a lot more "i"s than "w"s when you use a proportional font like Arial. Still hoping for a property of some sort that's obviously NOT well documented!

Thanks anyway!
Jim

[This message has been edited by jimbrooking (edited 10-02-2001).]
 
Alex,

Thank you for this reference. It does not apply here, as the data I'm displaying are pre-defined within memo-type fields in a table, and not subject to modification by users.

The data/memos are actually summaries of different requirements of the US regulations on privacy of medical records, and must be available for display in their entirety. What I was looking for was some way to provide a visual cue to the user that indicates the need to scroll the field to see the remainder of the field. Absent that, I have set the focus (DoCmd.GoToControl) to this field in the OnCurrent and OnOpen events. This activates a vertical scroll bar, thus providing my visual cue. However, placing the focus there makes the user click elsewhere to do what the form asks, namely indicate the user's degree of compliance with the requirement.

Thanks again,
Jim
 
jimbrooking

do a bit of searching on that same site
You will find another sample of code automatically adapting text font size to accomodate a fixed size control.

If your text do not exceed too much the side of your control it might be a solution?

Or...
would it be a solution to tag your memo control at the same time that you put the focus onto it (on current), in order to be able to detect, toggle off the tag, and by pass the on clik event when the user just comes have triggered the on current event?

Alex


[This message has been edited by Alexandre (edited 10-04-2001).]
 

Users who are viewing this thread

Back
Top Bottom