Contiguous Forms

jcruzAME

Registered User.
Local time
Today, 09:14
Joined
Oct 5, 2011
Messages
135
Is there a way to make these resize on their own based on the number of records? Auto Resize is set to yes. Also, it's a subform.

Basically, I just need it to resize on it's own so there's only one scroll bar (it's a tab on a Navigation Form).
 
Last edited:
Stephen Lebans has a hack that basically gives Controls on a Form the same Can Grow/Can Shrink capability Access only provides for Reports.

I've never had occasion to us it, but Lebans hacks are top of the line, and a Subform is a Control, so it may be worth looking at.

http://www.lebans.com/cangrow.htm

As far as 'rolling your own,' the general logic would involve
  1. Determining how many Records need to be displayed
  2. Testing to determine the Height the Detail Section of the Form the Subform is based on needs to be in order to accommodate that many Records
  3. Setting the Form's Detail Section to that Height
To be honest, either way, this is way more effort than I'd be willing to exert for your stated purpose, but that's just me!

Good luck with your project!

Linq ;0)>
 
Yeah, the problem I encountered yesterday is with List Boxes, I would use list count to determine how many records there were and resize accordingly. With this it doesn't look like I can do record count.

If it's a contiguous from, what's the code for getting the record count?

Like for list boxes it was lstname.listcount. With this all I get is recordset and recordsource. Not sure what to code after that to get a count. Currently I use the code me.subfrmLiabilities.form. etc. to access it and requery it when needed but I'm not sure how to get the record count.
 
To get a true record count you have to force Access to load all records in the record set, so something like this should work:
Code:
Private Sub Form_Load()
 DoCmd.GoToRecord , , acLast
 DoCmd.GoToRecord , , acFirst
 TotalRecords = RecordsetClone.RecordCount
End Sub
Linq ;0)>
 
Thanks for the code! That seems to be working when the page first loads.

Now, if I refresh the page, how can I get that code to run again? On current?

EDIT: On current doesn't work. Is it possible to run Form_Load() from anywhere on the top form?

EDIT EDIT: For some reason that code grabs the same number every time. I'm using a query that grabs certain values out of a query based on which advisor is currently selected.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom