Solved

Misaligned borders in Access form

Posted on 2008-06-25
15
832 Views
Last Modified: 2013-11-28
I have a subform (Continuous Forms) with solid borders (Hairline) in an Access form. The subform is aligned with labels on the form, also with solid borders (Hairline). Label heights are set to 0.1875". Textbox heights in the subform are set to 0.1875".
The borders don't line up. This is a tiny issue, but it's really starting to tick me off. I've turned off Align To Grid, set GridX and GridY in the form and subform to 16. They still don't line up and it looks like trash.
Does anyone have any suggestions/solutions?
0
Comment
Question by:SCHale
  • 8
  • 7
15 Comments
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 21882305
What specifically is not lining up.  Issues like these always have an reason ans solution but I'm not entirely sure what specific alignment issues you are having beyond the fact that they revolve around something within a Sub form and relative to something in it's parent.  

If you can offer some specifics I think I can sort out your mystery for you.

Rick
0
 

Author Comment

by:SCHale
ID: 21887031
I want the borders around the subform data fields to line up with the label borders in the main form.
Currently, I'm fudging the sizes of the main form labels and making them overlap (like dealing a poker hand). With non-transparent backgrounds, I get the effect I want, but I don't understand why I can't specify the heights and widths of both the textboxes and label, and make them match. It's a real pain in the neck to manually position every label on my form.
0
 

Author Comment

by:SCHale
ID: 21887047
Basically, I want my form to look like a spreadsheet.
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 21887055
I'm trying to reproduce the problem you're having so I can understand it's cause.

It sounds as though you have labels above a sub form that are not lining up with the contents inside it.

Can you provide some information such as the Top, Left, Height, Width of the label above the sub form, one with in it and the sub form itself.  I may ask for more if that doesn't reveal the problem but I'm hoping that should be enough.  You shouldn't be having the problem described.
0
 

Author Comment

by:SCHale
ID: 21888009
Open the form fTimeCard and look at the border alignments between the form and subform. All labels and textboxes are .1875" high. Also notice that the column headers don't line up either.
Copy-of-PTM.mdb
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 21888308
Looking at the sample file you provided it appears that you have everything lining up nicely.  

Bear in mind that while in design view the sub form displays the vertical and horizontal rulers that will cause the contents to be shifted down and to the right vs. their actual location during runtime.

Is that the disparity you're referring to?
0
 

Author Comment

by:SCHale
ID: 21888448
FYI:
I'm using a new Dell D830 Latitude.
Access 2003, SP3
MisalignedBorders.png
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 21890549
I'm glad you posted the image.  I might have been guessing for some time.  

Bellow is a screen shot of my own where you should see everything is in fact lined up.

I suspect there's something else at at play here.  What is the screen resolution under which you are running your application?
TimeCard.PNG
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 21890736
Not to let this one go I tried some screen resolutoins of my own, 800X600, 1024X768, 1280X768, 1280X1024, 1600X1200, 1920X1200 including normal, large and extra large fonts with not change.

Then it occurred to me that perhaps you're trying to print the form, something that could very likely cause the problem illustrated.  I tried it and it did.

There are some things you can do but there's only one really good way to fix the problem if in fact this is the cause.

Set the Sub form controls Can Grow and Can Shrink properties to Now.  Remove the Sub Form's border, leaving it as a hairline border but make it transparent.

This will improve things a lot but I'm sad to say it will not make it perfect.  If perfection is the goal the answer is to build a report.  Rendering Forms as reports is a quick and dirty way around building the report but its not perfect (as is so clearly demonstrated here).  Reports aren't perfect either but you have a lot more control and can can prevent the issues seen here.

Hope this helps even if it may not be what you want to here.  If there's more to the story though don't give up, just let me know what it is and I'll give it another look.

Rick
0
 

Author Comment

by:SCHale
ID: 21902180
My resolution is 1920x1200. I'm not trying to print the form: I agree with you, that forms and reports need to be separated. "Layout for print" for the form is NO.
I have noticed that, even though I've turned off Snap To Grid, sometimes when I type in a precise value for a position or size, Access will recalculate the value to something close: say 0.190" becomes 0.1903". This may be related to GridX/GridY (both currently at 16).
One thing I haven't tried is setting GridX/Y to 1, to normalize the position/size calculations (or set GridX/Y to their max values (64)).
0
 
LVL 16

Accepted Solution

by:
Rick_Rickards earned 250 total points
ID: 21902733
The issue of things like 0.190" becomes 0.1903" while annoying isn't the cause of the problem (at least not directly).  This happens because for reasons I can not begin to rationalize, someone at Microsoft thought it would be a good idea to have us enter the property values in units of Inches when in fact the actual values stored is twips.  There are 1440 twips per inch and unfortunately when you enter your measurements in factions of an inch that doesn't alway divide out equally into twips.  0.190" for example works out to 1440*.19=273.6 which then rounds up to 274 twips which doesn't translate back to inches either 274/1440 = 0.19027777777777777777777777777778" adding to the rounding chaos which Access solves by rounding once again to 0.1903", (sigh).  How much simpler it would be if they just let us enter the number of twips.  It's like storing things in centimeters but being required to enter all measurements in inches (they don't translate straight across and so the rounding madness ensues). In any case, my point is that that is probably not the problem.  If you're controls all share the same values then they should line up.  Changing the X/Y grid won't help either as that's merely affects the dots you see in design view to help you line things up.  Snap to grid, while making it easier sometimes to line things up shouldn't make a difference if at the end of the day, you're controls all share the same left, right, height, width measurements.  Sigh!!!  Well anyway, while I puzzle over your problem searching for the answer I thought I'd take a moment right now to at least help you rule out things that it is not.

I too am running 1920x1200 and what has me going is the fact that your alignment looks great on my machine while clearly being off on yours.  Since were running the same .mdb, looking at the same form, same settings and well everything should be the same, yet clearly it is not.

Grasping for theories.  

Have you tried a different Video driver.  Something is clearly not right here and there is a lot of translation done while rendering images based on resolution that the driver should handel.  As if Twips and inches wasn't enough, when we talk about the screen, pixels are the point of measurement and the number of pixels per inch depends on your resolution compounding madness by the fact that the number of pixels per inch on the X and Y axis are usually not the same.

Bottom line, you have every right to be aggravated.  Waht I'm seeing should work, it works on my end and it bothers me that it is not considently so for you.  Makes me wonder how many forms I've built that are askew by a pixle here and a pixel there because of whatever anomaly is causing this.

Forgive my tenacity, I don't like unsolved mysteries like these so if you'll bear with me I'll continue to puzze this mystery in my head until we find the cause.  There is always a cause, I just need a moment to contimplate all that I know, all that I think I now and figure out what is part of what I think I know needs to be amended.

My working theory right now is that this is Video Driver Issue and if you can rule that out in some way, (use a Generic driver for the sake of a test if you can) that would help.  Also if you have another monitor you can use it would be interesting to see if it made a difference.  I trust these are flat screens so we have the benefit of being sure that the pixels are off.

Rick

Bottom line, if you'll bear with me I'll keep working this issue doggedly until we find the answer, (I don't like not knowing).

Rick



TimeCard1.PNG
0
 

Author Comment

by:SCHale
ID: 21909759
Thanks for your perseverance. This is an application, internal to our company, so it isn't like it has to be visually perfect. However, there's no good reason for this.
It just occurred to me that we have several of these laptops in this office, probably running the same resolution, and certainly the same Access/SP. I'll have someone test this on theirs.
0
 

Author Comment

by:SCHale
ID: 21909964
I just had my boss check it out on his laptop: same model, same resolution, but different screen settings (DPI, etc.). His showed good alignment. I'm going to adjust my settings accordingly and let you know.
0
 

Author Comment

by:SCHale
ID: 21910258
It's a conspiracy: either Bill Gates or someone in our IT dept. is trying to drive me insane (some people would say it's a short trip).
It works now. I adjusted my custom DPI (144) to 200 and rebooted. I set it back to 144 and rebooted. It worked both times.
However, our IT dept. has this silly habit of updating software in the background, so that everything is applied when we reboot. It may not be the DPI. I may have updated something that affected this. I'll never know.
However, I appreciate the time you've spent on this. Your comments made me think about the problem in a whole new light and now my problem, though not solved, is at least fixed.
As I have time, I'll continue to find out what the actual issue may be (I refuse to let a machine beat me). If I come across anything, I'll let you know (and vice versa, please).
MisalignedBorders2.png
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 21912080
It sounds as though you have in part confirmed my theory, albeit refined the cause somewhat.  The dpi settings are related to the way your video card behaves and as manufactures have begun to provide support for high dpi settings problems have emerged.  Just do a search in Google for High DPI Bugs and you'll start to get the idea.

It used to be that most user interfaces were designed to look good on 96 dpi displays.  Unfortunately, scaling is not a perfect solution and certain GDI devices scale poorly and if that wasn't bad enough there are a variety of Microsoft products that have similar problems.  From the sounds of it it would seem you've bumped into one of these issues.

If there is any comfort to be had it is that through all of this it is probably knowing that your work was in fact right all along.  If this should happen to you in the future you'll probably find that adjusting your video settings is a good place to start.  Probably a good idea to hang onto the form and sub form you have its current state as a baseline.  If you suspect something isn't as it appears you can always pull this form up to see if it's appears to be out of alignment knowing full well that it is not.

Rick
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now