Can't change listbox column header name when data source is a sharepoint list

Mailliw

New member
Local time
Today, 06:54
Joined
Jan 23, 2013
Messages
5
Hello,

The following code works to change the column header name for a listbox in form view when the data source is a local table, but not when the data comes from a sharepoint list.

Code:
sqlstatement = "SELECT ID, PONum as [PO Number], ActDate as [Date], VendorName as [Vendor Name], Service, BuildingNumber as [Building Number], ReservationDescription as [Description], POAmount as [Amount], QuoteType as [Type of Quote], Comments" & _
                " FROM  ActivityLog" & _
                " WHERE (Activity = 'AcceptReservation') AND (PSCName = '" & Me.PSCCombo4.Column(0) & "')" & _
                " ORDER BY ActDate;"

'MsgBox sqlstatement
Me.EditPOListBox.RowSource = sqlstatement
sqlstatement = ""
Also it appears that there is no such thing as a caption property for a sharepoint list column.

Any ideas?

Thanks!
William
 
Have you tried just one field alias first to verify that it won't work at all? The reason I ask is that you have [Date] in there and that can possibly be the culprit. Can you do it if you only use

Select ID, PONum As [PO Number]
 
Have you tried just one field alias first to verify that it won't work at all? The reason I ask is that you have [Date] in there and that can possibly be the culprit. Can you do it if you only use

Select ID, PONum As [PO Number]

Tried your suggestion and it still doesn't work. I tried double quotes instead of square brackets and also a single word (MyNumber) without either.

Thanks for your reply.
 
Bump.

Any other way to change those headers?

Thanks
 

Users who are viewing this thread

Back
Top Bottom