[AccessD] How to right justify numeric fields and pad withspaces on the left.

Brad Marks BradM at blackforestltd.com
Mon Jun 6 17:15:56 CDT 2011


Stuart,

Thanks for the help, I really appreciate it.

Brad


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart
McLachlan
Sent: Monday, June 06, 2011 4:53 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] How to right justify numeric fields and pad
withspaces on the left.

I normally use:

Right$(Space$(x) & str$(myNumber),x)

but you can also use

myString = space$(x)
rset mystring =  str$(myNumber)

Note that str$() is not strictly necessary because VBA will implcitly
convert myNumber to a 
String, but I prefer to do it explicitly.


-- 
Stuart

On 6 Jun 2011 at 16:12, Brad Marks wrote:

> We are using Access 2007 to create an output file for another firm.
> 
> The specs for this file are dictated by the other firm.
> 
> The specs call for numeric fields to be right justified and padded
> with spaces on the left.
> 
> What is the best way to do this with Access 2007?
> 
> Thanks,
> Brad
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.





More information about the AccessD mailing list