AccessDiscussion 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 .
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?
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.
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.
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.