Results 1 to 8 of 8
  1. #1
    Travis is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2020
    Posts
    15

    Question Setting width of a printed field will not stay precisely as set; Access makes it a bit narrower.

    Hi.



    I have a report based on a table that's working fine.

    Now, I want to create the same report based on a query.

    The query is selecting the proper records for me. So far, so good.

    When I have the report in design view, I'm trying to set the properties exactly as they are in the report based on the table. Height, Left, Top work as expected. But, when I try to set the width of the field in the new report to the same as the report based on the table, Access is always reducing my set width by a tiny little bit.

    On the one hand, it doesn't create a particular problem, but this:

    It's driving me nuts why I can't set it as precisely as I would like it to be, as I did in the first version of the report.

    What am I missing here? Please help, and THANK YOU!!

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I have found that sometimes you type in a dimension and Access alters it a bit, even if it's a dimension that you copied from some other control on the same report/form. I never figured out why but didn't really try. That's because invariably there's always a bit of white space between the last character in a value and the end of a control and typically, you don't put borders around most report controls anyway so who's to know it's not exactly what I typed in for a width value?

    I suppose you could try copying from one report to another and see if the desired value holds. I'd say it could be an issue with gridline spacing in the design grid except that you can't have one setting for one report and a different setting for some other report. Perhaps it has something to do with horizontal placement on the grid, then when you try to size it, it wants to adjust the width to conform to the grid. Perhaps check the placement of the left/top position (you didn't say if it was horizontal or vertical dimension you were struggling with) and see if they're the same in both reports. What I don't get is why you'd create 2 reports that are basically the same if the query is based on the same table.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    The issue occurs because you are setting the dimensions in cm (or inches) but the various aspects of the screen display are actually done in three sets of units called twips, pixels and points where 1 inch =1440 twips, 1 pixel =15 twips and 1 point = 20 twips. So the dimensions are rounded to the nearest decimal equivalent in cm/inch. Confusing isn't it!

    For a detailed explanation and more info than you'll probably ever need on managing form/report sizes, see my article http://www.mendipdatasystems.co.uk/m...ols/4594549378
    Hope that helps
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    Why not just change the recordsource?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    @isladogs, why then can you set the width of a control to a value on one report yet on another report Access will not allow that same value to be used on a control on another report - or even the same report? A value that works for one control should work in another in all cases in that particular db but it has been my experience that many times, it doesn't. I'm afraid I don't see where the conversion comes into that.

    EDIT - I just notice the word "printed". I was referring to what happens in design. My bad, I guess.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    The point is that the control widths (etc) are actually set in twips and the nearest approximation to that value is displayed in cm.
    The actual width will be close to the value shown but in many cases not exactly equal to it.
    It doesn't matter whether you are referring to different forms/reports or different controls in the same object.

    Do bear in mind that the twip is exactly 1/1440 of an inch but that is only approximately 1/567 of a centimetre...so rounding errors are inevitable.
    And of course, you can't have a part of a pixel....but I digress....

    As a simple example I just created a textbox and tried to set its width to 4.13cm. Access changed it to 4.131cm
    I then created a second textbox and tried to set its width to 4.131cm. Access changed it to 4.132cm.
    So if I really wanted it to be 4.131cm, I have to specify its width as 4.13cm.
    Or of course just set the smaller textbox to match the wider one.

    Hope that makes sense...my article probably explains it better
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I edit my post before I saw yours.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Quote Originally Posted by Micron View Post
    EDIT - I just notice the word "printed". I was referring to what happens in design. My bad, I guess.
    I'm also referring to what happens in design. The printed size will of course depend on what happens in the design stage
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 06-06-2017, 10:59 AM
  2. Setting Height and Width with VBA
    By MatthewR in forum Reports
    Replies: 9
    Last Post: 10-29-2015, 12:26 PM
  3. Making a report narrower
    By Lou_Reed in forum Access
    Replies: 8
    Last Post: 08-17-2015, 12:03 PM
  4. Replies: 5
    Last Post: 04-06-2015, 09:49 PM
  5. Replies: 2
    Last Post: 06-20-2012, 02:21 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums