Solved

Can I wrap field names in a query in Access 2003?

Posted on 2006-11-14
8
296 Views
Last Modified: 2012-08-13
Is it possible to wrap field names in a query in Access 2003?  Someone asked this question about Access 2000, and the answer was no, so I suspect the answer is still no.  

However, the alternative suggested was "Use a form or report with a field property of CanGrow = Yes."  So I tried this on a form and on a report, but the field names still do not wrap.  I think there is some other piece of information that I am missing to make this approach work - does anyone know what that might be?  Thanks.  
0
Comment
Question by:grovduck
  • 5
  • 2
8 Comments
 
LVL 7

Expert Comment

by:Imoutwest
ID: 17942656
Can you provide an example of what you mean? Where do you want the fields names wrapped?
0
 

Author Comment

by:grovduck
ID: 17943185
Sure thing.  We have some fields in our db that have long names even though they're already abbreviated, e.g PLANT_ASSOC_CODE.  In Excel I could change the height of the first row and enable wrapping to make the names look like this:

PLANT_
ASSOC_
CODE

That way I can still see the entire name of the field, and I can also get more fields to fit on the screen.  I just want to know if there is a way to do that in Access.  
0
 
LVL 7

Expert Comment

by:Imoutwest
ID: 17943274
I will have to check this out, I would think based on the length of the field you should be able to adjust the height of the label that the field name is filling.

Then the issue how to handle the '_'.

I will play will this at home tonight and see if its possible.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 58

Assisted Solution

by:harfang
harfang earned 50 total points
ID: 17943658
Hello grovduck

The column title of a datasheet view is the caption property of the field, or the field name if there is no caption. The caption can contain new line characters, although only the first line of the caption will be shown in datasheet view.

When you create a form or a report, the caption (or, again, just the field name) is copied to a label, attached to each control. That label will display several lines in form view or on a report. In other words, if you see a label with "PLANT_ASSOC_CODE", edit it, delete each underscore and replace it with a new line (Ctrl+[Enter]), and perhaps resize it if needed. That's all there is to it, really.

For that matter, you can just as easily display graphics as column titles on a report or a continuous form.

To have captions wrap automatically when you create a report is an entirely different matter, and would require writing your own "report wizard".

(°v°)
0
 
LVL 7

Accepted Solution

by:
Imoutwest earned 75 total points
ID: 17944166
grovduck,

I think that you're trying to do this the hard way. Access table already provide this functionality for you.

In the design view of the Table:

Caption: the label for the field when used on a form. If you don't enter a value then the field name is used for the form (report).

Therefore PLANT_ASSOC_CODE could be the field name and Plant Association Code code be the caption (label). Without the underscores the field name will automatically wrap to fit the width and height of the label on the form(report).

So there wouldn't be a need to program this in VBA as I think was first suggestion, since when you create the form or report the label can be sized to fit your need.

If this isn't what you're talking about, then I'll still try to do it in vba (just to see if I can), although once your setup your form or report you wouldn't need to change it programically.

Imoutwest
0
 
LVL 7

Expert Comment

by:Imoutwest
ID: 17944173
or are you talking about Datasheet view (like an excel table)?
0
 
LVL 7

Expert Comment

by:Imoutwest
ID: 17944669
I've been doing some reading on this and if your talking about the gray-area in the datasheet the I believe that the answer is sadly "No". However, if your talking about a continous form then there maybe some flexiblity there, but it will not work like a table from Excel.
0
 

Author Comment

by:grovduck
ID: 17949669
Thanks for the info on captions Imoutwest and harfang.

Imoutwest,
Yes, I did want the names to wrap in datasheet view, but it sounds like I would have to create a form or report instead.  Our database is split with the back end on SQL Server and the front end in Access.  So I have created a bunch of queries (views) in SQL Server that I  link to in Access.  These views are listed in the tables tab in Access, and I would like to avoid having to create reports for each view.  So I guess I will either live with the long field names or decide to create reports.  

Thanks to both of you for telling me how to wrap the names in forms and reports.  
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question