Changing listbox column head titles? (1 Viewer)

Sharky II

Registered User.
Local time
Today, 03:50
Joined
Aug 21, 2003
Messages
354
Hi there

I have a listbox and all is well - the only problem is that the column heads are a little 'ugly' - my column names are usually something like 'catagoryName', 'productType' and 'price' instead of looking pretty, like 'Catagory Name' and 'Product Type' and 'Price' respectively.

Is there any way to edit/format the title/column heads without having to change all the tables and queries etc, so they look a littler prettier?

Many thanks

Edd
 

wazz

Super Moderator
Local time
Today, 10:50
Joined
Jun 29, 2004
Messages
1,711
i think you can only change the headers at the table or query level. or, you can turn the headers off.

btw: make sure it's a category, and not a catagory.
 

Sharky II

Registered User.
Local time
Today, 03:50
Joined
Aug 21, 2003
Messages
354
aww, shucks. that kinda sucks. that makes things messy, as can be seen from the attached pic

i'm not sure whether to leave it, or go back and change all queries, tables, code, and forms with new names, typed out 'nicely'

i'm a java coder so i'll use lowercase out of habit, plus it's easier to read when using vbcode

thanks for the category correction!

anyone have any last ditch ideas?
 

Attachments

  • access.jpg
    access.jpg
    29.8 KB · Views: 3,090

WayneRyan

AWF VIP
Local time
Today, 03:50
Joined
Nov 19, 2002
Messages
7,122
Sharky,

In the Row Source for the combo (or List Box) change the SQL to:

Select Field1 As NiceHeading1, Field2 As NiceHeading2, ...

There are limitations, but it's an improvement.

Wayne
 

Sharky II

Registered User.
Local time
Today, 03:50
Joined
Aug 21, 2003
Messages
354
you are the absolute man!

can't have spaces, but it's much nicer now, i think

many thanks!
 

WayneRyan

AWF VIP
Local time
Today, 03:50
Joined
Nov 19, 2002
Messages
7,122
Sharky,

Select Field1 As [You Can Have Spaces], Field2 As ...

Wayne
 

WayneRyan

AWF VIP
Local time
Today, 03:50
Joined
Nov 19, 2002
Messages
7,122
Sharky,

After some thought,

1) Set Headings to NO for the combo or listbox

2) Use a textbox(s) to make your own really nice looking headings with
multiple lines/headers, etc.

3) Set the textbox(s) to INVISIBLE

4) Use the GotFocus event of the combo/listbox to set textbox(s) Visible

5) Use the AfterUpdate event of the combo/listbox to set textbox(s) invisible

Wayne
 

RCurtin

Registered User.
Local time
Today, 03:50
Joined
Dec 1, 2005
Messages
159
I know this is an old post but just came across it now.

A very easy of doing this is just set the Caption property in design view of the table. Access uses the field names if there are no captions set.
 

byterbit

New member
Local time
Yesterday, 22:50
Joined
Feb 22, 2011
Messages
7
Prior to adding data to the listbox, add one line, which will become the column headers, as in:
Me.List4.AddItem "Seq" & ";" & "Proc #" & ";" & "NO" & ";" & "Operation" & ";" & "Spec" & ";" & "Tech".
Be sure to turn on headers in properties. Note too that I'm adding data to the list box manually in a do while loop from a recordset.
 

GIS_CCWD

New member
Local time
Yesterday, 19:50
Joined
Oct 15, 2014
Messages
1
The other quicker way to acheive this is through the query used in the list box

1. Open the query used in the list box in design view

2. In the Field rowwhere you want the different heading change it to
New Heading:[OldField]
 

bradipo78

New member
Local time
Yesterday, 19:50
Joined
May 4, 2016
Messages
2
Hi all,

Anybody knows how to do the same with a listbox that has a value-list rowsource, instead of table/query?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 03:50
Joined
Feb 19, 2013
Messages
16,620
see post #9 of this thread

Basically make the first row your headers
 

Alex10k

New member
Local time
Yesterday, 22:50
Joined
Jan 15, 2021
Messages
3
GIS_CCWD - your comment (#10) provided a simple and perfect fix for me. Thanks so much!
 

Users who are viewing this thread

Top Bottom