Two new "how to" videos on anchoring and parameter dialogs

The sudden demo Watch this: Make a control move as you resize a form is now live on Office Online. This is a companion demo to Watch this: Make a text box grow or shrink as you resize a form, published earlier.

We also just published a video demo for queries: Watch this: Make a query ask for input.

Office Blogs Comments

Comments: (9) Collapse

  • Hi,

    I am happy that the issue of anchoring has recently been discussed in several posts and comments here in the blog (see posts and comments from 22,26 and 30 of January). I think this is a very important user interface issue and hope that it will continue to evolve for the next version. I would like to continue the discussion on this issue from the blog item from the 26 of January. Basically my claim in this discussion was that the issue of anchoring and the issue of scaling forms for different screen resolutions are related. I think that the latter is more important. I think that users will generally not want to bother and stretch forms each time they open them. I believe that it is more convenient for users to just open the form and have it already scaled to the most comfortable size, and then just use it. The videos that are posted here demonstrating the stretching of forms are very impressive. But in my view, this stretching function is not really that useful for day to day use. Both the stretching of forms and their rescaling on startup have been achievable in previous versions of access using code. I find that if a user must stretch a form every time it is opened, he will eventually just leave it as it is, and continue to work with it as uncomfortable as it may be, because he will want to save himself the bother of additional actions on the screen. Maybe some other people will find it very useful for their purposes, but I personally just don’t find it as such. I nevertheless am very happy that it has been added because I see it as a step in the direction of enabling form rescaling to fit different screen resolutions, as they are opened. This I believe will be much more helpful since it is common that different users will have different screen settings, so a developer can develop for one resolution without being able to foresee how the application will actually look in some other user’s machine. Here is what Steve Palm had to say in response to my claim: # Steve Palm said on January 30, 2008 10:18 AM: Hi Gilad,

    You can solve that problem by saving the position and size of each Form to a table or windows registry and then setting it the next time the users opens that form. This way the user only has to size the form 1 time and from that point forward it is always opened to the size they set it. An API call to the MoveWindow can be used to do this and it works very well. Steve Well, Steve, thanks for this idea. I may try it, although I am not sure this is optimal for the following reasons:

    1) The anchoring feature is instigated by the user’s action of stretching the form. I am not sure it will also be instigated by the API call, or by the VBA call to move and size the form. Have you actually tried this?

    2) Even if this were to work, it is not simple to achieve. The whole point of adding Anchoring to Access 2007 was to reduce coding. What you are suggesting requires quit a bit of sophisticated code (although I do recall that the same book I mentioned earlier in this discussion also has the code to achieve your suggestion, so I have a place to start).

    3) What about sub-forms? Are the controls in Sub-forms also stretched accordingly as the parent form is stretched? And what if a form is opened, and then the user can click a button on this form to replace a bound sub-form (I find this option great). This newly replaced sub-form will then also need to be scaled to fit its parent form. If the parent form was stretched, and then its sub-form replaced with a different one, I wonder if the sub-form will be appropriately sized and located. I have managed to achieve this using the code I mentioned earlier, but hopefully, the anchoring feature will replace the need for such cumbersome and complicated code. To sum, I hope the next Access version will automatically ‘remember’ the size of the forms after they are stretched by the user, so he will have to stretch them only once. And also, I hope that this feature will take into account the ability to replace sub-forms in an open parent form, and scale them appropriately to the parent form’s size and location after it has been stretched.

    Thanks for reading

    Gilad

  • From a user interface perspective, I find the Tags on the RHS of the team blog distracting. Can you tone them down a bit. Eg Access 2007. I would rather see a recent articles list.

  • Why Access 2007 doesn't support ODBDirect connections? Please, what kind of features currently supported, Access 14 will not include? Bye

  • Hi Gilad, You can see a great example of this working in Image Accounting Premier which can be downloaded here.

    www.comtechsolutions.com/demodownload.aspx Once you install it and login, select “Bank Reconciliation” from the Accounting menu. This form has 2 subforms which are sized along with the other controls. This is a great example of how anchoring can be achieved in Access 2002/2003. After you size it and move the form around, close it, and when you open it you will see it remembers the exact size and position you previously set. You can see this same technique in several other forms like the General Ledger, Orders, Invoices, Bills, Find forms, etc. This was all done in Access 2002/2003 with no third party controls. This functionality has been in place in Image Accounting for over 4 years and is being used in the real world every day by many companies we sell to. We have never had any problems with it, so I can assure you it really works well. Before that, we used the scaling code you mentioned and had several quirky problems with it (especially with complex forms and subforms) so we removed it. Between the new anchoring feature in Access 2007 and the API code to save and get the forms size and position, there is nothing else you need. The only wish I have for the next version of Access would be a built in property to save a forms size and position. Then you could do all the above with NO code. Thanks,

    Steve

  • Steve,

    Thanks greatly for your response.

    I think Access is a great product and that you have been able to utilize it so well. I think there aren’t many people who have managed to use Access to sell shareware products like I understand you have done. The deployment issues are just too complicated. For the benefit of Access and its users, I think the Access team should make an effort to make it easier to accomplish so others will be able to do so as well. But all this notwithstanding, I think you missed my point this time. I too have the form resize working well in Access 2003, as I have noted previously. My questions concerned Access 2007. I was referring to the Anchoring feature.

    I do understand your additional point of saving the previous location and size of the form, and then reinstalling them when the form is re-opened. This idea was presented in the Developer’s Handbook as well. But I am not sure the idea of saving the form’s size after it has been stretched using 2007 Anchoring, and closing it and using API calls to give it the same size on re-open will instigate the Anchoring feature. By ‘Anchoring feature’, I mean the fact that all the form’s contents will automatically scale and move appropriately to the same size and location they had when the form was stretched and then closed. My doubts are caused by my understanding that this movement of the form’s contents (in 2007 anchoring) are caused by the user’s action of resizing the form. So I was wondering if the API call will also automatically trigger this Anchoring behavior in 2007, without using additional code. Secondly, you did not address my comment about changing the sub-forms after the parent form was already opened and stretched. Then, without closing the stretched parent form, but only by clicking a button on it, you can replace a sub form with another different one.

    Essentially, what you are doing in this case is closing only the sub-form and opening another. I do have these ‘replaced’ sub-forms scaled appropriately to fit their stretched parent form in 2003 using code, but I was wondering if this could also be accomplished in 2007 using Anchoring without using additional code. I think this must also work for replaced second and third level sub-forms as well. Thanks

    Gilad

  • I am new to Access, would like to create a database. I have received following error while running a query. Can any one guide me. "Query Cannot be completed. Either the size of the query result is larger than the maximum size of a database (2 GB), or there is not enough temporary stroage space on the disk to store the query result" I have 7 GB space in my PC. Memory 503 MB. Regards

    Sriram

  • Sriram, I suggest that you post your question to one of the many newsgroups available for Access-related questions. This blog site is not the proper place to post specific questions related to your database. Outlook Express includes the ability to configure NNTP newsgroups. Check with your ISP for specific instructions. You can also use a web browser to hit many of these newsgroups. For example: Microsoft.Public.Access (also available on NNTP)

    www.microsoft.com/.../default.mspx Utter Access (web based only)

    www.utteraccess.com It is also helpful to provide more details, including your operating system, the version of Access that you are using, the service packs applied to your operating system and to your version of Access. Operating system information can generally be obtained by clicking on Start | Run and entering the command: WinVer. Version and service pack info. for your version of Access should be available in the Help | About Microsoft Access menu (Access 2003 and prior versions). Include information about the size of your database, and whether you have recently compacted it. How many records are in the table that you are querying? What is the SQL statement for the query (open the query in design view, and then click on View | SQL View. Copy the SQL statement and paste it into your posted question).

  • Hi Gilad, Yes, this does work in Access 2007 and will resize the form and controls automatically when you re-open it. Maybe the best thing for me to do is give you a working example in Access 2007. Feel free to use any of this code in your application. ****IMPORTANT****

    Make sure you enable the VBA Macro if the Access Security Alert appears or it will not run the code to size the form. www.comtechsolutions.com/.../AnchorSize2007.zip You will see that the function call to get the forms size and position is extremely easy to use in your application. All you need to do is call 1 line of code in the forms OnLoad and OnUnload event. Then copy the small module in the above example to your application and you should be all set. Private Sub Form_Load() ' Get the Forms position. cswPositionGet Me, True

    End Sub Private Sub Form_Unload(Cancel As Integer) ' Save the Forms position cswPositionSave Me

    End Sub Thanks,

    Steve

  • Thanks again Steve,

    I will have a look

    Cheers

    Gilad

Comments

Comments: (loading) Collapse