Text align left

sparx

Morphed Human
Local time
Today, 11:21
Joined
Jul 22, 2002
Messages
80
I am creating a query where fields are all fixed width. When the field is numeric I fill the field with zeros, when the field is text, I fill it with empty spaces. The problem here is that the empty spaces get added before the text, but I want the empty spaces to get added after the text, meaning left - aligned. Anyone have any ideas??

Tks,

Sparx
 
I think the problem you are having is a bit more complex then you make it out to be. I am sure you tried [TextField]&" " and it still showed the field in left alignment in the datasheet view. That is just the way access deals with the Text datatype it always left aligns that data (so you can add spaces all day and it will sadly not help fix the problem). If you take the data to a report then you can align it they way you want if you add the spaces first like above. Good luck.

GumbyD
 
Your reply doesn't help too much
 
A workaround to this is to build a datasheet form which looks like a query, then set the underlying form controls aligned how you want and return to datasheet view, the alignments will be inherited. To print the data use a report as suggested above which I thought was a good explanation.
 
>
... but I want the empty spaces to get added after the text
<


Try this to get a fixed length of e.g. 15 characters

Left([TextField] & space(15),15)
 
Jon, that's the type of answer I was looking for, thanks a lot
 
Sorry if my answer did not help much. I was under the impression that you wanted the data to line up in a right alignment in the datasheet view of a query, which as far I know you can not do with a text datatype. I used Jon's expression with does give you a fixed length 15 character string, but it still aligns to the left. If it is just to get your data to look a certian way then I think you will want to take the data to a report and align the field there. I really am trying to assist you with your issue, but no one person knows everything about Access which is what makes these forums so great - because you can get lots of ideas and input. I hope you get what you need. If anyone out there does know how to right align a text field in the datasheet view of a query I would like to know how to do that too.

GumbyD
 

Users who are viewing this thread

Back
Top Bottom