Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Form/subform can grow/shrink.

Posted on 2003-10-30
6
Medium Priority
?
762 Views
Last Modified: 2012-06-21
I'm trying to come up with a form that will display data from several tables. I'll just display one record from the main table, but there may be several records from supporting tables. I usually use sub-forms for this type of situation, but in this case, I want the support records to display fully, without scrolling.

So, this is easy to do in a report, but since can grow/shrink doesn't work with forms, I'm just wondering if there are alternatives to accomplish what I want.

I've played around with changing the subtforms .height and .top properties (based on # of records) and can probably make it work that way, it just seems like a very large amount of code to handle about 6 or 7 subforms and other contronls that come between and after the subforms.
0
Comment
Question by:avoorheis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 32

Assisted Solution

by:jadedata
jadedata earned 300 total points
ID: 9652170
Hey avoorheis!

  Your simple answer here is to set the subforms to a size that is most comfortable for all views of the data.
  And to segregate the subforms in such a ways that other controls don't interfere with "lengthening" the subform.
  Perhaps a Tab control for the subforms would serve this purpose.
 
regards
Jack
0
 
LVL 39

Assisted Solution

by:stevbe
stevbe earned 150 total points
ID: 9653026
tabs would work good as jack suggests, you might also consider making the height of the subforms as large as the screen will hold ...

Me.childForm1.Height = Me.InsideHeight - (Me.childForm1.Top + me.Section(acFooter).Height)

Steve
0
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 9653151
Stack your subforms (all with 0 heigt) very closely in top of one another in detail section of your main form, like:
=================================================    sf1    continous
=================================================    sf2    continous
=================================================    2f3    continous


In the on openevent of you form include
Dim Qty1 As Integer, Qty2 As Integer, Qty3 As Integer
Qty1 =Dcount("*","Table_sf1","add your criteria here")
Qty2 =Dcount("*","Table_sf2","add your criteria here")
Qty3 =Dcount("*","Table_sf3","add your criteria here")
Me!sf1.Height=1.667*1440*Qty1     ' you may need to add a constant correction value to this
Me!sf2.Height=1.667*1440*Qty2     ' you need to experiment with it
Me!sf3.Height=1.667*1440*Qty3     ' 1.667" is defaul value.  I usually change it to .15"

Mike
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:avoorheis
ID: 9654841
Mike,

I tried your suggestion, but the first subform covers up the second subform. Are you saying that the subforms after the first one actually move lower on the form (depending on the height of subforms that come before them)?
0
 
LVL 34

Accepted Solution

by:
Mike Eghtebas earned 1050 total points
ID: 9654881
Sorry about it, use:

Dim Qty1 As Integer, Qty2 As Integer, Qty3 As Integer
Qty1 =Dcount("*","Table_sf1","add your criteria here")
Qty2 =Dcount("*","Table_sf2","add your criteria here")
Qty3 =Dcount("*","Table_sf3","add your criteria here")
Me!sf1.Height=1.667*1440*Qty1  
 
Me!sf2.Top=Me!sf1.Top+Me!sf1.Height
Me!sf2.Height=1.667*1440*Qty2

Me!sf3.Top=Me!sf2.Top+Me!sf2.Height  
Me!sf3.Height=1.667*1440*Qty3    
0
 

Author Comment

by:avoorheis
ID: 9663698
thanks guys
I guess there really isn't some magical way to make a sub form act like a report, but your suggestions will help.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
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…

636 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