473,385 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,385 developers and data experts.

When to Use Layouts: The Synergy of Layouts and Anchors in MS Access 2010

topher23
234 Expert 100+
A layout provides a grouping method for controls on a form or report. The two default layout types are Tabular (labels in form header, controls in detail), and Stacked (labels to the left, controls to the right, all in detail). Regardless of which layout you choose, you can edit it afterward to work any way you please.

You apply a layout under the Arrange tab, in the Table group. Layouts in Access are an emulation of HTML tables, which may explain why the Access team refers to them as Layouts but put them in a ribbon group called Table. And let's not even discuss the confusion between a Layout and Layout View.

If you are building an Access Web app to post to a Sharepoint server, your forms must use a layout, according to Microsoft's Access 2010 Help page for controls and layouts (http://office.microsoft.com/en-us/ac...controllayouts). This makes sense, since the layouts create HTML tables that Sharepoint server can use in its data-driven model.

When it comes to a desktop database, however, Microsoft gives no compelling reason for using the layouts, noting only that "layouts are optional if you are building a desktop database that will only be opened by using Access" and suggesting that they are useful in creating a uniform look for your form. Microsoft completely fails to note the power of a layout coupled with the Anchor properties in a sizable form.

Anchors are one of the other recent innovations in Access. Until Access 2007, a control's position was set by the Top and Left measurements and remained static throughout the life of the form, unless changed in code. With the introduction of Anchors, the developer could choose how a control moves when a form is resized. Controls are anchored both vertically and horizontally, so a Close button at the bottom-right corner of a form can remain always in the bottom-right corner, while the header stays in its customary position at the top left. Anchors can also make a control grow and shrink with the form, by setting the Anchor properties to Both. With the anchor at Both, the control holds its initial Top and Left settings, but increases or decreases in size as the form is resized, holding the distance between the control and the bottom and/or right sides of the form static.

This is great, but then when the developer sets an Anchor property to Both for two controls on the same level, there's a problem; if the user stretches the form, the controls overlap each other as each holds to both its constraints. The way to solve this problem? Layouts!

When you put your controls into a layout, they are constrained within the table outlined by the layout. This means that, no matter how many controls you have lined up top-to-bottom and left-to-right, you can select the entire layout and set the Anchor properties to Both without any overlap. As the controls shrink and grow within the layout, the layout shrinks and grows with them, justifying each control to the table. Et Voila! Thanks to your layout, you now have a form that resizes on the user's demand, without any complex coding on your part.
Apr 14 '14 #1
1 7543
NeoPa
32,556 Expert Mod 16PB
Nice :-)
Apr 14 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: jaad | last post by:
Hello, I have a database that was written in access 2007 on my pc. I wanted to work off site with the database so I uploaded it onto my laptop which is loaded with access 2010 beta. When I...
2
by: sierra7 | last post by:
It seems Access 2010 is associating an 'input mask' or field type with a combo box when a form is opened, even though there is no Format setting on the control. I have a form which has been...
1
by: Alan Yim | last post by:
Hi folks, My company recently upgraded our Office suite from 2003 to 2010. The problem in particular is with an Access database that was originally designed in Access 2003. The code in question...
5
by: neelsfer | last post by:
I got a new work laptop last week with Access 2010 pre-loaded.I also installed the new Office 2010 service pack 1. I then loaded 2 of my regularly used Access 2007 + service pack 2 applications on...
9
by: Vernon Halsey | last post by:
I have an Access database that has been is use for approx 8 years. It was originally written in 2000 and subsequently converted to 2003. It consists of a client-unique front-end linked to a shared...
4
by: jbrumbau | last post by:
Hello, In Access 2010/2007, how do you prevent users from flipping into design view from the ribbon? I do not want to hide the entire ribbon (DoCmd.ShowToolbar "Ribbon", acToolbarNo) or even the...
4
beacon
by: beacon | last post by:
Hi everybody, My title may not exactly describe my issue, so please forgive my lack of creativity today. I've got a database that was created in Access 2003 that I've opened in Access 2010. I...
2
by: Paul Howarth | last post by:
My Access 2010 database is suddenly not appending Named Ranges from Excel into and Existing Access 2010 Table. I have not written any code. I simply right-click the Table-Import-Excel and follow...
11
by: Jo Ann Dullum | last post by:
I have a table in Sharepoint 2010 that users have submitted proposals into. I have a link to it in my Access 2010 database. The link works perfectly on my XP laptop but not on my Windows 7 desktop....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.