Solved

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

Posted on 2006-11-14
8
287 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Retrieve Windows Office Files from Parallels 12 VM 9 59
DSum for Access 6 43
Run Time Error 3075 15 41
combine ShipTo and BillTo Address 3 22
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

930 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

10 Experts available now in Live!

Get 1:1 Help Now