Solved

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

Posted on 2015-02-02
8
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 48

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 37

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 48

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 48

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

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.

Question has a verified solution.

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

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

710 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