[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I make the notes subform shrink/grow depending on how much text i have in the field?

Posted on 2011-10-25
9
Medium Priority
?
638 Views
Last Modified: 2013-04-05
I created a notes subform. In that subform, one of the column is called notes. I also have another column called date. Some of my notes are really long. Others are really small. How do i make it so if my note is small, the row shrinks so the row isn't huge. Also, if the text is really long, how to i make it so the row gets bigger to show all of the text? I tried highlighting the date and notes fields, the selecting "Yes" to "Can Grow" and "Can Shrink". But that didn't work. What else am i missing? THanks!!!
0
Comment
Question by:tols12
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 12

Assisted Solution

by:pdebaets
pdebaets earned 200 total points
ID: 37029126
0
 

Author Comment

by:tols12
ID: 37029148
Um...any other ideas?
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 400 total points
ID: 37029161
Can Shrink /Grow on a Form only apply when you print the form, otherwise they have no effect. So, you only option is to either create a Report OR ... use the option suggested by pdebaets above ... or the earlier version of that which is http://www.lebans.com/cangrow.htm

mx

0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 

Author Comment

by:tols12
ID: 37029199
Ok. I have everything set to shrink/grow. I think click on the print button you helped me with earlier, but it still desn't shrink. I checked both the report and form, everything is set to shrink and grow. When i print the report, it still doesn't shrink or grow.
0
 
LVL 75
ID: 37029205
Kind of hard to troubleshoot ... can you upload ... and explain exactly how to reproduce the problem ?

mx
0
 
LVL 49

Assisted Solution

by:Dale Fye
Dale Fye earned 600 total points
ID: 37030322
First, you need to make sure that both the control and the section (usually the detail section, but could also be a group by section) has it's CanGrow and CanShrink properties set to Yes.

From Access help:
Sections shrink vertically across their entire width. For example, suppose a form has two text boxes  side by side in a section, and each control has its CanShrink property set to Yes. If one text box contains one line of data and the other text box contains two lines of data, both text boxes will be two lines long because the section is sized across its entire width. To shrink the data independently, you can place two subform  or subreport  controls side by side, and set their CanShrink property to Yes.

When you use the CanShrink property, remember that:

- The property settings don't affect the horizontal spacing between controls; they affect only the vertical space the controls occupy.  
- Overlapping controls can't shrink.
- The height of a large control can prevent controls beside it from shrinking. For example, if several short controls are on the left side of a report's detail section and one tall control, such as an unbound object frame, is on the right side, the controls on the left won't shrink, even if they contain no data.
 

0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 800 total points
ID: 37031003
Can you clarify the reason why this must be in a form and not a report (where this is ridiculously simple)

Yes, you can print a form, ...but forms are primarily used for data entry, hence you are provided with "scrollbars" to view data that is too big to fit.

I have seen code to look at the number of characters and "dynamically" change the size of the control, but it is a bit to complex (and never really perfect)

Again, if create a report, all you have to do is set the cangrow and canshrink properties to Yes, and you are all set.


In your form use code similar to this on a button to view the current form record as a report:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "YouirReport", acViewPreview, , "YourID=" & Me.YourID

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37031114
sample attached

You can obviously open the report on it's own to view all the records with their associated "Notes" filed/controls properly sized to fit the text.

;-)

JeffCoachman
Database521.mdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37031521
...or you can just use a messagebox, to display the full notes, depending on your needs:
 
msgbox me.txtNotes


0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question