A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Is there a way to center (horizontally) items in a list box?



 
 
Thread Tools Display Modes
  #1  
Old November 10th, 2009, 09:27 PM posted to microsoft.public.access.forms
Wol Bruin
external usenet poster
 
Posts: 1
Default Is there a way to center (horizontally) items in a list box?

I want each individual item in the list box to be centered horizontally. I don't see any properties that allow me to do this, nor any VBA code I can apply. When I tried adding leading blanks and using a fixed font such as Courier New, Access would trim off the leading blanks and left justify the text.
I am using MS Access 2007.

Thanks

EggHeadCafe - Software Developer Portal of Choice
HTML Hyperlink Obfuscation with Client Script
http://www.eggheadcafe.com/tutorials...bfuscatio.aspx
  #2  
Old November 12th, 2009, 04:52 AM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Is there a way to center (horizontally) items in a list box?

Open in design view, click on Property Sheet and format property Text Align
sekect Center.
--
Build a little, test a little.


"Wol Bruin" wrote:

I want each individual item in the list box to be centered horizontally. I don't see any properties that allow me to do this, nor any VBA code I can apply. When I tried adding leading blanks and using a fixed font such as Courier New, Access would trim off the leading blanks and left justify the text.
I am using MS Access 2007.

Thanks

EggHeadCafe - Software Developer Portal of Choice
HTML Hyperlink Obfuscation with Client Script
http://www.eggheadcafe.com/tutorials...bfuscatio.aspx
.

  #3  
Old November 12th, 2009, 05:39 AM posted to microsoft.public.access.forms
Gina Whipp
external usenet poster
 
Posts: 3,500
Default Is there a way to center (horizontally) items in a list box?

Karl,

You can't center text in a list box... but I found something you posted a
little back that works like a charm...

SELECT Space(15-len([FieldName])/2) &[FieldName] FROM [TableOrQueryName];

Note, you may have to play with the * -15 * depending on the width of your
list box.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"KARL DEWEY" wrote in message
...
Open in design view, click on Property Sheet and format property Text
Align
sekect Center.
--
Build a little, test a little.


"Wol Bruin" wrote:

I want each individual item in the list box to be centered horizontally.
I don't see any properties that allow me to do this, nor any VBA code I
can apply. When I tried adding leading blanks and using a fixed font
such as Courier New, Access would trim off the leading blanks and left
justify the text.
I am using MS Access 2007.

Thanks

EggHeadCafe - Software Developer Portal of Choice
HTML Hyperlink Obfuscation with Client Script
http://www.eggheadcafe.com/tutorials...bfuscatio.aspx
.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.