Solved

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

Posted on 2006-11-14
8
284 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now