List box column headers

Pauldohert

Something in here
Local time
Yesterday, 16:07
Joined
Apr 6, 2004
Messages
2,101
I have a list box that I need to show the column headers, I need to change the field names for more decriptive names for the users. This is complicated by the fact the rowsource for the list box is the same rowsource for a combo box - which is set to field list, the combo box is used to select a sort order for the list box - if I put the descriptive names into the combobox my order by clause for the list box is incoorrect.

Anyone got a solution other than hardcoding?

Thanks
 
Not sure but have you tried aliasing the field names. I assume that somewhere you have a query selecting the value

If you have not used an alias before

In the query if you put a new name followed by colon in front of the field name

so a field in the query called intNameCode becomes Name by amending within the query as

Name:intNameCode

Do not know but suspect that since combo and list box are sharing source both now use the "new" field names so all may be fine

Len B
 
Thanks Len - yes I have tried aliasing the fields - and they show up correctly in the listbox and the combo box. I porbably didn't explain this correctly - what I want to do is pass the value from the combo box ( as a string fieldname) to order the list box. However when I have aliased my fields - the alias isn't recognised when passed to the ORDER BY Clause of SQL.

A solution would be to have the combo box showing the aliases but passing the actual feild names ( but can't seem to work out how it is done) have tried things like changing captions and descriptions - but still seem to be stuck with the same problem.
 
Okay how about instead of using the same record source ( a query I presume) use a query for one source and query the query for the second source, not exactly sure where this will go but if the combo uses the second source it would sidestep any alias confusion perhaps.

The other thought is in the source to have the oringinal field and the field again but this time aliased.

You could control what people see by setting column width to 0. That way the original column name is there but not seen and the meaningful name verson is the one that people see. This then totally obviates the passing of an alias

Perhaps
Len B
 
Thanks Len - I think I'm confusing myself with this one will give those a go!
 

Users who are viewing this thread

Back
Top Bottom