MS access listbox header color

Custom Column Heads.

Mihail
759 512MB
Hello again !

Is it possible to have custom Column Heads in a ListBox (ComboBox) ?

I have a ListBox bounded to a table (if necessary I can bound it to a query).
One field (or ListBox column) is for prices.
This prices (all of them) can be either in European money (Euro) either in Romanian money (Lei).
If the prices use Euro or Lei, is the user choice and, of course, this information is stored somewhere in the database.

So, is it possible to have custom head for the column in my ListBox like "Price [Euro]" if Euro is used or "Price [Lei]" if Lei is used ?

Thank you !
Jun 2 '13 #1
Follow Post Reply
MS access listbox header color
MS access listbox header color
MS access listbox header color
6 21532
MS access listbox header color
TheSmileyCoder
2,321 Expert Mod 2GB
I have not looked much into this, but I believe the only way you can change the headings of a combo/listbox is to
Use Alias (as) in the underlying SQL for the query
AND the field from the table must have no caption property set, or the caption will overrule the field name.
The combo/listbox must also be set to use field names as headers.

I know of no other method, but then again,I haven't tried to research it either.
Jun 2 '13 #2
reply
Mihail
759 512MB
Thank you, Smiley.

I know about Alias, but is not what I am looking for because is STATIC.
I am looking for PROGRAMMABLE column heads, that means DYNAMIC column heads.
Hope you can understand what I mean, beyond my poor English.

In the other words I wish to define the column heads in terms like this:

Expand|Select|Wrap|Line Numbers
  1. String_1="Mynameis"
  2. String_2="Mihail"
  3. ListBox.Column(4).Head=String_1&String_2
So, the 4_th column in the list box to be My name is Mihail
Jun 3 '13 #3
reply
MS access listbox header color
Oralloy
983 Expert 512MB
Mihail,

Try looking at the ListBox Columns in the debugger watch window.

Is there a property that carries the header text in it? If so, can you affect that property, or is it read-only?

Cheers,
Oralloy
Jun 3 '13 #4
reply
MS access listbox header color
TheSmileyCoder
2,321 Expert Mod 2GB
Hi Mihail.
The rowsource of a listbox is not static. You can dynamically change the rowsource through VBA. Note that any change of rowsource also triggers a requery, so if the listbox contains many records, or the connection is slow, this might not be acceptable.

Expand|Select|Wrap|Line Numbers
  1. Me.ListBox.Rowsource="SelectAmountASDollarsFromYourTable"
Or
Expand|Select|Wrap|Line Numbers
  1. Me.ListBox.Rowsource="SelectAmountASDinerosFromYourTable"
I don't really know of any other way to do it.
Jun 3 '13 #5
reply
MS access listbox header color
zmbd
5,400 Expert Mod 4TB
Quite simply, using the built-in listbox control T.S.C. has the correct answer...
Now you can attempt to change the caption of the underlying query field, alter the alais, etc.. ; however, I personally haven't tried this so I don't know if such would work for what you are after.
:

ListBox.ColumnHeads Property (Access)Office 2013 (2010)
The RowSourceType property specifies whether field names or the first row of data items are used to create column headings. If the RowSourceType property is set to Table/Query, the field names are used as column headings. If the field has a caption, then the caption is displayed. For example, if a list box has three columns (the ColumnCount property is set to 3) and the RowSourceType property is set to Table/Query, the first three field names (or captions) are used as headings.

If the RowSourceType property is set to Value List, the first row of data items entered in the value list (as the setting of the RowSource property) will be column headings. For example, if a list box has three columns and the RowSourceType property is set to Value List, the first three items in the RowSource property setting are used as column headings.

If you can't select the first row of a list box or combo box in Form view, check to see if the ColumnHeads property is set to Yes.
Jun 3 '13 #6
reply
Mihail
759 512MB
Thank you (all of you) for trying to find a solution.
The answer to my question is not something which burn me.
I can use custom captions for labels instead the custom column heads.
Only I am wonder if it is possible to have programmable column heads for a ListBox (or ComboBox).

@Oralloy
Of course I can't find a property like this. It is why I ask here.
I post a pseudo-code because my English is not very good.

@Smiley
It is not about the row source. It is about the column head(s) only.
Sorry (again) for my poor English.

@ZMBD
As I say (#1) my ListBox is bounded.
So, "the field names are used as column headings" (or the field caption if exist).

@You, ALL
I know that I can accomplish this task if I use SQL in VBA:
Expand|Select|Wrap|Line Numbers
  1. strSQL="customSQLstring"
  2. ListBox.RowSource=strSQL
but this approache is not what I am looking for.

Thank you, again, for yours time !
Jun 4 '13 #7
reply
Message
Cancel Changes

Post your reply

Sign in to post your reply or Sign up for a free account.

Post Reply

Similar topics

PHP
Write custom column names to query result file
2 posts views Thread by Joe Gazda | last post: by
.NET Framework
Custom Column for a DataGrid web form control
1 post views Thread by CGuy | last post: by
Microsoft Access / VBA
ListCount bug with column heads
reply views Thread by Darryl Kerkeslager | last post: by
C# / C Sharp
DataGrid/ComboBox custom column problems
3 posts views Thread by Bill C. | last post: by
ASP.NET
custom column format for asp.net datagrid
1 post views Thread by adam | last post: by
ASP.NET
my first datagrid custom column - feedback appreciated!
reply views Thread by Wee Bubba | last post: by
ASP.NET
GridView custom column display.
2 posts views Thread by typingcat | last post: by
C# / C Sharp
Custom Column Headers for ListView
1 post views Thread by GruBByMaster | last post: by
Visual Basic .NET
Datagrid Color Custom Column
reply views Thread by simchajoy2000 | last post: by
Microsoft Access / VBA
How do I use ORDER BY with a custom column name?
2 posts views Thread by mindxing | last post: by
eCommerce
MS access listbox header color
The Best Way to Hire eCommerce Web Developers in 2022
reply views Thread by eddparker01 | last post: by
Mobile Development
MS access listbox header color
How to Hire a Programmer in 6 Easy Steps for a Startup
reply views Thread by eddparker01 | last post: by
General
lancet: a comprehensive, efficient, and reusable util function library of go
reply views Thread by lanliddd | last post: by
Microsoft Access / VBA
MS access listbox header color
UK Access User Group (AUG) Seminar
reply views Thread by isladogs | last post: by
Microsoft Access / VBA
MS access listbox header color
TIP: Drag & Drop with Database Objects
1 post views Thread by isladogs | last post: by
C# / C Sharp
Access Exif metadata
1 post views Thread by DGrund | last post: by
C# / C Sharp
Access Exif metadata
1 post views Thread by DGrund | last post: by
Microsoft Access / VBA
ComboBox is not Refreshing the List after the Change event.
2 posts views Thread by Ademar | last post: by
General
Access Exif metadata
reply views Thread by DGrund | last post: by