Form/Subform formatting question

  • Thread starter Thread starter Veli Izzet
  • Start date Start date
V

Veli Izzet

Hi all,

I have a form with a subform, where the subform is in datasheet style.
Some items in the form has no subitem, whereas others may have up to
10-15 subitems.

I want to format the subform to grow when there are lots of subitems and
be somewhat minimiszed else.

I changed the Can grow to yes, but nothing changes.

Thanks for answers
 
CanShrink, CanGrow are for printing not the screen. You might try counting
the number of rows and using that at a multiplier for the subform control
height. Here's some aircode that might help:

Me.SubformName.Height = Me.SubformName.Form.RecordsetClone.RecordCount * 500

The 500 is the measurement in Twips which is how measurements are made in
forms and reports. There are 1440 twips to the inch. You will need to
experiment with the number of twips, as well as the code.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Thanks Arvin,
1- Where do I put the code?

2- This is a very legitimate and simple request (I mean mine). Why on
earth has nobody in MS Access team thought about it and put something
similar to CanGrow for the screen?
 
I'd build an event procedure in the Current event. That way it will change
with every record change on the main form. Remember, that was aircode (i.e.
untested) I've never done this before, and while it should work, it will
take some experimenting with the twip count to get it right.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top