you don't have any control of positioning in a listbox. Only thing you could so is put some spaces before the x
I've never needed it, but Stephen Lebans did some neat things:
http://www.lebans.com/List_Combo.htm
When the listbox is expanded to choose from you don't, but the resulting text can be centered after the list is closed.you don't have any control of positioning in a listbox
@OnlyLonely - what is you have shown in your screencap? It doesn't look like a form - it looks more like a report. Whichever it is, in form/report design view you can set the "X" to display centered using "format" on the ribbon.
@John_G - are you thinking of a combobox?
I think OP is using listboxes to display data, not for user selection, at least that was my understanding of description in other post.
'centering' the data will require padding with leading spaces. If the data is text and always the same length, can simply adjust in the listbox RowSource query: " " & [fieldname]
If data is number can do same or use Format() function, example: Format(Min([RepYear])," 0000")
Last edited by June7; 10-10-2017 at 01:03 AM.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
What do you mean by expanding a listbox? Are you thinking of a combo box?When the listbox is expanded to choose from you don't
Certainly I'd agree that centering in a report or form is simple if the field is a text box or combo (you can easily center the selection in a combo - not so much it's column data). I have to wonder what that image is too since the columns are bordered and there are no horizontal lines. Could be done with a lot of small vertical lines, just long enough and tight enough to create a continuous vertical line. If that's the case, simply move the lines for the x column. Or is this easily done in a report with anything newer than version 2007?
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Oops!!
Mea Culpa All! Yes, I was thinking about a combo. Sorry 'bout that. Next time I'll be more careful.
I've found my solution. Is an easy way.
Go to listbox - property sheet - Allow Value List Edits (Yes) - Go to table and align the "X" to center.
I learn something new every day!
Yep, new one for me. However, if your RowSource is a query, that approach is not available.
Also, if the table is linked, the setting will not carry over - will have to set it in the frontend link, in spite of the linked table edit warning.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Simple Solution
Go to the source table <the list box or combobox source>
make the text aline in center in the table and save table
go to your comboobx and see the magic
thanks
6 year old thread?
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
Not only that, same answer as given in post 8.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.