Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 8th, 2005, 03:29 PM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Controlling width of fields in a subform

Hi All,

I am using access 2003. I have a subform which displays 3 fields derived from a query filtered via a combo box. The whole thing works well except that One of the fields is a memo field that can have quite long descriptions. My problem is that whilst I can arrange the field widths manually on the subform, this formatting is not saved and I can find no subform property that allows me to set the field widths in the subform. Can anyone tell me whether it is possible to do this with code and if so give me a line or two of code to demonstrate how it is done,

many thanks :)

HowardB

 
Old April 11th, 2005, 07:45 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can change the field width using VBA. The property you are looking for is Width.

However, I suspect something else is going on. You should be able to save the field width when you set it manually.

Do you have the form's "Allow Design Changes" property set to "All Views" or "Design View Only"?

If you are allowing design changes only in design view, then when you manually set the width of the field, changes won't be saved.

Try working with the subform directly (don't use the main form). In design view make sure that the you allow changes in all views. Show data in form. Adjust the width of your field, save changes and close the form. Then open the main form and see if the width isn't as wide as you previously made it.

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org
 
Old April 13th, 2005, 06:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

And if the width is still not big enough, remember that people can zoom in on any field in any form by using Shift+F2. Just put a label on your form somewhere reminding people of that.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable fields in a subform ltdavecass Access VBA 4 January 31st, 2007 09:43 PM
accessing fields in a subform Hudson40 Access VBA 8 March 25th, 2005 06:15 AM
Width in pixels from width in percentage bsausser Classic ASP Basics 1 December 31st, 2003 02:31 PM
check subform fields damnnono_86 Access 1 December 29th, 2003 11:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.