Results 1 to 6 of 6
  1. #1
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188

    textbox margins

    I'm trying to set the margins on textboxes so they align correctly. See attached screenshots.

    The differences in the data is [UnitPrice] and [Extension] fields are currency fields in the database.


    [UnitPriceEx] and [ExtPriceEx] are converted from a text field. See below fields.
    I displayed them as both bound and unbound to make sure that was not causing the discrepancy.

    Why does the underlying data make a difference on margins, even with the text being converted to currency?
    Is there something else I'm missing?

    Code:
    UnitPriceEx: Format(Trim(Mid(Nz([PODetail]![Descrip3],""),InStr(Nz([PODetail]![Descrip3],""),"[unit_price: ")+13,(InStr(Nz([PODetail]![Descrip3],""),"[ext_price: ")-2)-(InStr(Nz([PODetail]![Descrip3],""),"[unit_price: ")+13))),"Currency")
    
    ExtPriceEx: Format(Mid(Nz([PODetail]![Descrip3],""),InStr(Nz([PODetail]![Descrip3],""),"[ext_price: ")+12,InStr(InStr(Nz([PODetail]![Descrip3],""),"[ext_price: "),Nz([PODetail]![Descrip3],""),"]")-(InStr(Nz([PODetail]![Descrip3],""),"[ext_price: ")+12)),"Currency")
    Thanks!
    Attached Thumbnails Attached Thumbnails S1.jpg   S2.jpg  

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Make sure the format property of the textboxes is the same. This can happen when they have different formats.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    When I adjusted attributes and settings I had them all selected collectively. They are all Currency with 2 decimal points. Oddly, when I change the top margin they all adjust equally as expected. When I set the right margin, they all move as expected. However, they move based on the default margin of 0 which is different between the types of data sources. The above textboxes screenshot are all set at 0. Notice how they are offset on the right. They will move when I change the right margin, but will still maintain the offset.

    For giggles, I changed the all to left align and they line up perfectly. I use the left margin and they all move as expected keeping alignment. It's only the right align offset that is causing issues.

    thanks!

  4. #4
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    I found a solution. Still don't know why though.

    When I edit the query for the currency field and format them as currency in the query, they now line up as expected.

    Thanks!

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad you found a solution. I don't think I've ever played with the margin properties of textboxes. I suspect the format property of the textbox didn't work because you were returning a string value in the query (because of the Format() function).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    I was using the Format( [Field],"Currency") in the query for the text string.
    The margins did not respond as expected until I did the same for the Currency fields in the database.
    Would be interesting to know why, but having found a solution I can move forward.

    Thanks!

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

Similar Threads

  1. Report Margins
    By Pure Salt in forum Reports
    Replies: 3
    Last Post: 04-26-2016, 07:41 AM
  2. Report margins on end user machine
    By maryj in forum Access
    Replies: 1
    Last Post: 05-27-2014, 03:12 PM
  3. Need help With Margins/Column Height
    By jjohnsonhm in forum Access
    Replies: 7
    Last Post: 10-09-2013, 07:25 AM
  4. Margins for OLE Unbound Rich text box
    By yoili in forum Reports
    Replies: 0
    Last Post: 02-17-2013, 11:46 AM
  5. Print Preview Margins error
    By yes sir in forum Access
    Replies: 2
    Last Post: 09-15-2010, 05:52 PM

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