Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display column header with spaces in it in a listbox?

Status
Not open for further replies.

davidd31415

Programmer
Joined
Jan 25, 2006
Messages
154
Location
US
Access 2000-

I am trying to display spaces in column headers in a list box with no success so far. I have tried the following xyntaxes in the Row Source:

SELECT myField AS 'My Field' FROM myTable;
SELECT myField AS My Field FROM myTable;
SELECT myField AS [My Field] FROM myTable;

Since I'm populating .RowSource from VBA I haven't tried quotation marks. When I use the query builder and then look at the SQL Access seems to use square brackets.

Any advice?

Thanks,

David
 
this does not work
Code:
SELECT myField AS [My Field] FROM myTable;


Code:
me.lstbox.rowsource =" SELECT myField AS [My Field] FROM myTable;"
 
The following works for me (ac2003):
SELECT myField AS [My Field] FROM myTable;

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top