Text alignment for queries

GaelicFatboy

Registered User.
Local time
Today, 23:09
Joined
Apr 17, 2007
Messages
100
Hi All,

I’ve formatted all my tables to display text and number with a left hand text alignment. When I view the table all the data is aligned correctly to the left of each field, but when I display any queries using the same data the fields are aligned to the left for text and to the right for numbers.

Is there any way for the queries to be configured so that they display the data in the same format as in the tables?

Cheers

D
 
I think you probably need to set up a form or report for it - where you'll have lots of control over the layout and appearance - queries are really just about the raw data.
 
I've placed a sub form within my main form and my query data is viewed from here, but the text is all out of alignment. Is there a option within the query setup to copy the original data format and have all my query data viewable with a left hand alignment?

Cheers

D
 
I'm not sure about that, but it should be possible to specify the text alignment by opening the subform in design view and editing the Text Align properties of the relevant text boxes.
 
short of that, ahve you tried converting all of the numbers to strings?

Not nice, but it should work.
 
Cheers gents, It's not essential to align the data to the left but more a point of aesthetics so converting all the data to string values is a touch of over kill.

Cheers anyway. If I find a solution I'll drop a post.

D
 
Queries are not for viewing data by the user... Reports and forms are. Allignment options are as far as I know not available in queries and IMHO rightfully so...
 
Cheers gents, It's not essential to align the data to the left but more a point of aesthetics so converting all the data to string values is a touch of over kill.

Cheers anyway. If I find a solution I'll drop a post.

D

Why isn't the alignment possible in design view in your subform? :confused:
 
Just to put a bit more flesh on the bones.

I've got a child sub-form with its 'Source Object' set to a query which lists the filtered electrical data for a given range of equipment.

If I focus on the child form in design view I cannot see any text alignment parameters for the child sub-form or its associated query.

If anyone out there knows how I can force the query in the child sub-form to adopt the text alignment as set up in the tables from which the data is taken or fix the text alignment for the sub-form then I'm all ears.

Cheers anyway.

D
 
You should be able to open (in design view) the child subform alone - independently of its parent - it should be listed in the forms tab (or section) of your objects browser - in there, you should be able to set the alignment properties for the fields in the subform.

Some versions of Access let you edit the subform inside the main form, but even with these, it's often not very practical to do so.
 
I don't actually have a sub-form saved as a form I have the sub-form object with its source object parameter set to the query listing the data.

So in essence I'm showing the query straight up on screen for an engineer to edit the data directly.

D
 
I don't actually have a sub-form saved as a form I have the sub-form object with its source object parameter set to the query listing the data.

So in essence I'm showing the query straight up on screen for an engineer to edit the data directly.

D

Well, you ought to change that, for two reasons:
-It's just not a good practice to let users interact with tables and queries directly - that's why forms and reports exist.
-You can't modify some things like text alignment in a query.

Create a datasheet form based on the query and use that as the source object for the subform, and you will be able to format it to your heart's content.
 
Cheers for that Mike,

I don't actually allow access to the query as it's locked. The query is there only for viewing data that can be used by the engineers in other parts of the programme. I was just trying to align the text to improve the look of the query.

I guess my form looks a little like a split form, with the bottom section being a locked view only query.

Anyway, cheers for the advice.

D
 
To left align right aligning text stick "!" in the format properties of the field in query design view.
Matt
 
Cheers for that Matt I'll give it a go.

Sorry for the late reply I've been on holiday.

D
 
To left align right aligning text stick "!" in the format properties of the field in query design view.
Matt

Hi Matt,
This works great. What I supposed to do for Center align and Right align?

Thanks in advance
Regards
Vijay
 
In my opinion it is best i people remember that tables are for storing data, queries are for selecting data, forms are for inputting and displaying data and reports are for displaying data often in printable form
 
Thanks, Matt, for this tip! It's still relevant many moons later.

I have just (for the first time in 15 years) come across this problem.

Text fields in table are left aligned but in the query they are right aligned with no option to change the format :banghead:... Other than my OCD I have no reason for the fields to be aligned either way but wanted to fix it all the same, which the format "!" totally did, so thank you!
 
I applied Matt's suggestion (#14) "To left align right aligning text stick "!" in the format properties of the field in query design view".
Also I found out that using "?" aligns text to the right. Does anyone know a similar way to force-align the text to center?
ReinM
 

Users who are viewing this thread

Back
Top Bottom