Solved

How to right justify a column in a multi-column text box

Posted on 2015-02-02
8
179 Views
Last Modified: 2015-02-05
I need to right-justify a currency formatted column in a text box containing a number of columns.  How is this done?
0
Comment
Question by:David_W_R
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 200 total points
ID: 40584295
I've never heard of a multi-column textbox, do you mean a list-box?

List boxes always format the data as text strings, and automatically line up to the left of each column.  When I want to display numeric values, right justified in a listbox, I use a non-proportional font, and pad the left side of the string, something like:

Right(Space(10) & [SomeField], 10)
0
 
LVL 35

Assisted Solution

by:PatHartman
PatHartman earned 100 total points
ID: 40584303
I do it this way - which probably has the same effect as what Dale suggested so no points please unless this works and his doesn't.  I chose 12 as the width of the output field.  That gives extra room for the $ and commas and decimal.
Space(12 - Len(SomeField)) & SomeField
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 200 total points
ID: 40585402
If you do not need non-contiguous selections, (or if you just need to display these values), ...You may opt to use a small datasheet view subform
You will have to set the AllowEdits, AllowDeletions, and AllowAdditions, Properties all to NO
It will look something like this:
Subform...and the the Currency values will display in their native, Right Justified position...

JeffCoachman
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Closing Comment

by:David_W_R
ID: 40589410
I really appreciate the insight from each answer.  I think I'll use the datasheet to take advantage of the Access automatic formatting of currency.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40589665
Yeah, I should have mentioned that I have started using a lot more datasheets instead of listboxes because of their versatility.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40589791
Dave,
Yep, , it all depend on what you need.
If you had needed non-contiguous selects, you would not have been able to use the datasheet view.

Each approach will have advantages and disadvantages.
;-)

Jeff
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40589911
When I need non-contiguous selects, I simply add a Yes/No column to the mix and allow the user to "check the box".

Dale
0
 

Author Comment

by:David_W_R
ID: 40591344
I certainly appreciate the follow-up comments.  Thanks again all.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question