View Full Version : Text alignment for queries
GaelicFatboy 05-15-2009, 12:39 AM 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
Atomic Shrimp 05-15-2009, 12:42 AM 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.
GaelicFatboy 05-15-2009, 02:11 AM 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
Atomic Shrimp 05-15-2009, 02:21 AM 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.
obiron 05-18-2009, 07:49 AM short of that, ahve you tried converting all of the numbers to strings?
Not nice, but it should work.
GaelicFatboy 05-19-2009, 04:11 AM 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
namliam 05-19-2009, 04:19 AM 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...
Atomic Shrimp 05-19-2009, 05:24 AM 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:
GaelicFatboy 05-21-2009, 03:59 AM 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
Atomic Shrimp 05-21-2009, 04:07 AM 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.
GaelicFatboy 05-21-2009, 08:12 AM 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
Atomic Shrimp 05-21-2009, 08:29 AM 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.
GaelicFatboy 05-26-2009, 01:30 AM 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
matt beamish 07-30-2010, 06:34 AM To left align right aligning text stick "!" in the format properties of the field in query design view.
Matt
GaelicFatboy 08-04-2010, 03:17 AM Cheers for that Matt I'll give it a go.
Sorry for the late reply I've been on holiday.
D
|