473,387 Members | 1,529 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to calculate the size of a subform in an access report?

Hello

I have an access report which is being populated by a macro dinamically depending on the number of records in the database. The report has a header and a footer (and a subform placed in between)

Header and footer have a fixed format and height.


My problem is really that I want to know where my footer is going to sit. Furthermore, inside my footer I designed a box (Rectangle reads the selection type). All I want to know is where this rectangle will lie in the access report. This place will obviously depend on how long my report is

Thus, in the end, what I need to calculate is the height of the subform in the report.
Nov 22 '10 #1
1 1622
TheSmileyCoder
2,322 Expert Mod 2GB
Stephen Leban has some code that can estimate the height of a textbox (I.e. what height it will have after its "grown"). You can google him to find it.

If you use that, you can then calculate the forms height. If it is from within the form/report you can use:
Expand|Select|Wrap|Line Numbers
  1. Dim dblH as Double
  2. dblH=Me.Height-me.tb_Example.Height+fTextHeight(Me.tb_Example)
This basicly takes the design height of the form/report (Me.Height) and adjusts it by replacing the design height of the textbox (me.tb_Example.Height) with the runtime height of the textbox (fTextHeight(Me.tb_Example)).

It can be a bit tricky, but I've used code similar to whats described here to predict how large the next record would be, and whether or not it would fit on the page, and based on that info, choosing whether or not to insert a pagebreak.
Nov 23 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how...
15
by: Mark C | last post by:
All, I have exhaustingly been looking through the newsgroups in search of a way to systemically output an Access 97 report to a pdf file using the full version of Adobe Acrobat. I want the user...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
1
by: mar10a | last post by:
I am trying to insert a .gif. file into an Access report - using Insert Picture. The original image is 8X11, but access changes the size to 4X6.5. When I change the size of the image in access...
4
by: dkelly925 | last post by:
I have an Access Report that I am trying to enter an "If Statement" that when a certain field exceeds a certain number of lines or a certain number of characters that field is not visible and...
4
by: Yaro | last post by:
Hi, I am looking for information how calculate size of table with BLOB field. After RUNSTATS command select fpages * tablespace pagesize - gives me only 16kB (table contain about 10M) I...
2
by: rmfoley | last post by:
All, I would like to create a professional looking cover sheet with information loaded from an MS Access Report. I created the cover sheet in MS Word that includes my company logo, etc. My...
2
by: axp | last post by:
I would like to display a Programmatically calculated field inside an access report. This means that for each section (or Person) the code needs to be run with different data in order to calculate...
6
by: DeniseY | last post by:
I have an Access report that is created on the fly by the user selecting the fields to be included. The Access report comes out fine, but I want it to automatically output to an Excel spreadsheet....
2
by: Composer | last post by:
This is not a question but rather an answer, or at least a clue. Like others, I had experienced seemingly random truncation of text when exporting a perfectly good Access report to RTF. Or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.