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!

Displaying partial text when text greater than x chars

Status
Not open for further replies.

cascot

Programmer
Jan 30, 2002
127
CA
I have continuous forms displaying records that include fields such as people's names, company names, addresses, etc. My problem is that while a person's name ([Surname] & ", " & [Firstname]) can be up to 62 characters in length within my particular database, displaying a text box wide enough to display the potential maximum leaves little room for information from other fields. I know I can use two rows, etc, but the same problem applies... it becomes very difficult to layout fields when a field length may be 11 characters or 41 characters.

I have began to consider using IIF's within the underlying queries to present field data as either "FieldData" (if the length is no greater than a specified maximum) or "FieldData..." is it exceeds that specified maximum. This means I can use text boxes of more reasonable widths, knowing that should a name be very long I will see something like "VeryLongName..." rather than having the name be cut-off mid-letter as it disappears beyond the right-hand edge of the textbox. The presence of "..." also providing an indicator to the user that all available data is not currently visible.

Of course IIF's are far from efficient, and on a form that may potentially list a few thousand companies, that is not good news.

Does anyone have any ideas or approaches to dealing with this kind of data presentation problem, or any thoughts on my idea?
 
A couple of initial thoughts.

1. Why don't you size the text field to the 'average' name length - (e.g. maybe enough width to accomodate 20 characters). How many long names (41 - 62) characters as per above do you have? Also, you could teach the users to use Shift-F2 to expand field on long names as an alternative to scrolling to the right to see hidden text.

2. If the names are important to see I think truncating them thru a Right function or Left function is counterproductive.

3. Variable length text is always going to be an issue for many fields. Your design has to accomodate what is reasonable and then offer options to address 'out' cases. Scroll bars, Shift F2, Can Grow/Can Shrink, etc. are some of the possibilities.
 
evalesthy,

Thanks for your reply.

The idea is to present some basic information for each person or company on this list form, but full information is provided if the record is double-clicked or the "Select" button is clicked. So while the information is ultimately important to see, it probably isn't necessary to see...

Walker Thompson Reid eCommerce Security Consultancy Limited

Compared to...

Walker Thompson Reid eCommerce...

In order to know it's the company you want to select.

[purely ficticious company name of course!]

Limiting the displayed data to the second option of "Up to the first 30 characters" leaves room for other related information to be displayed such as Phone Number.
 
There's another dimension to your problem. If you let your users enter very long names then you're liniing yourself up for problems when they complain that the names are too big to fit on an address label and they screw up the mail merge format.

I give the user a ShortName and a LongName field. ShortName appears on most forms and reports. LongName only appears on the CustomerDetails form but I put into the ToolTip of the ShortName textbox whereever it appears.

Geoff Franklin
 
alvechurchdata,

Thanks for your reply.

I've taken care of that problem and other related name problems by having a "Mailing Label Name" which is initialy set according to what is entered in salutation, surname and firstname, but can be amended to be whatever the user wishes. I do the same for the address side of things, as international address formats vary so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top