Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 13th, 2007, 02:46 AM
Registered User
Join Date: Aug 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Continous Form, resize based on content (Tricky)

Ok here's one I haven't been able to find any documentation on.

I have several continuous form, subforms with large "Memo" based textboxes in them. However, some entries are very long (6-10 lines) and others are only a line or two. Visually it looks really ugly and is hard to scroll through so I'm look for a way to resize the height of each txtbox and the Detail section it is in based on the number of characters in the text box... Any ideas?

Reply With Quote
  #2 (permalink)  
Old August 13th, 2007, 11:52 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

Look up Form.InsideHeight, which sets the inside height of the form in twips (1400 twips per inch). I don't usually do this but that might help. You would do something like:

-Count the number of characters in the text box string.
-Figure out a formula for the number of twips based on the number of characters (get a sense for how many characters per line on average)
-Set the Form.InsideHeight based on the twips count.

Maybe like:

Dim sString As String
Dim iCount As Integer
Dim iTwips As Integer

sString = Me.TextBox 'check for nulls
iCount = Len(sString)

iTwips = ((iCount / 60) * 720) '1/2 inch of form height, for example, for each line of 60 characters

Form.InsideHeight = iTwips

I am not sure how this would work with a continuous form, though.

Did that help?

Reply With Quote
  #3 (permalink)  
Old August 13th, 2007, 12:02 PM
Friend of Wrox
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts

My experience with continuous forms, is that aside from data, every element of the form is duplicated for all records in the form. Hence any change to size, color, graphics or anything like that, that is data dependent will be the same.

It's pretty frustrating, and I would love to proved wrong... The closest solution I have found is allowing text boxes within the form to be scrollable.

This is one of the few area's where Access just isn't as flexible as a Web App or other programming languages.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tricky : Don't want to load MDI form first navdeep C# 2005 7 May 6th, 2008 01:51 AM
Resize form AccessAasif@aol.com C# 1 December 7th, 2007 03:53 AM
Is it possible to select record in continous form chiefouko Access VBA 0 July 18th, 2006 04:20 AM
Continous form problem Vince_421 Access VBA 10 June 1st, 2006 05:06 AM
Resize Form quocanh General .NET 1 October 12th, 2004 12:20 PM

All times are GMT -4. The time now is 05:30 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.