Solved

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

Posted on 2015-02-02
8
173 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 34

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
 

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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

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.

Question has a verified solution.

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

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now