473,387 Members | 1,530 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.

Eliminate spaces between records where record lines vary

I want to print a report. Each record may have blank fields which I eliminate with the can shrink property. However this leaves varying spaces between records. I would like to control the space between these records. Any help will be appreciated.
Oct 7 '10 #1
2 1384
jimatqsi
1,271 Expert 1GB
I think you'll need something like this in the Detail's onFormat event.
Expand|Select|Wrap|Line Numbers
  1. with Me
  2.  !detail.height = ?? ' whatever the highest value can be for your detail 
  3. if nz(!txtA,"")="" and nz(!txtB,"")="" and nz(!txtC,"")="" then
  4.     txtA.top = 0
  5.     txtB.top = 0
  6.     txtC.top = 0
  7.     txtA.visible = false
  8.     txtB.visible  = false
  9.     txtC.visible = false
  10. else
  11.     txtA.Top= ?  ' where you want the second line of the detail to begin. It's twips, not inches
  12.     txtB.top = ?
  13.     txtC.top = ?
  14.     txtA.visible = true
  15.     txtB.visible = true
  16.     txtC.visible = true
  17. endif
  18.     detail.height = txtA.top + txtA.height ' will shorten the detail if these 3 are at the top
  19. end with
  20.  
Also, if it could be that all the printed fields are blank you could do this in the detail format event:
Expand|Select|Wrap|Line Numbers
  1.    if (all of them are blank) then
  2.      docmd.cancelevent
  3.    endif
Jim
Oct 7 '10 #2
NeoPa
32,556 Expert Mod 16PB
A lot of good stuff there from Jim. You could also consider relying on Access never allowing a value less than that needed to display the contained items. Set it to 0 and it will set it as the lowest value it can. From here, add any value you want, to avoid that chopped look (like border space).
Oct 7 '10 #3

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

Similar topics

4
by: Lyle Fairfield | last post by:
This takes about 2 seconds on my rather obsolete machine: Option Explicit ' Test is a simple JET Table with four fields ' ID -> autonumber primary key ' Field1 -> Integer (maps to VBA long)...
0
by: Alex Egg | last post by:
I have this unformated text file, "demo.txt"... Now I need to be able to process it... By, processing it, I mean... After every 2 characters in the file, add 1 space, " "... Now there...
1
by: Sam | last post by:
Why when I write this Regex r = new Regex(@"+") String tokenList = r.Split(line) If line which is a string, has spaces at the end or start, Regex leaves an empty string at the end and start...
16
by: msundaram.visvanathan | last post by:
Hi, i tried to write this small code in C which would: Input :a b c d Output:abcd code: #include<stdio.h>
6
by: davidgordon | last post by:
Hi, I regularly code in standard asp with MySQL. I have a page which displays records with the background colour of each record table row in a different colour. There are 2 table rows per...
4
by: elainenguyen | last post by:
I am trying to generate a query from a table which has multiple dublicate records, but in the query, I don't want to show the duplicate record. I just want the duplicate records to show only one...
1
by: Aahz | last post by:
Hello, In my asp.net application I need to get url to string like this: str = Request.Url.AbsoluteUri; Problem is with url'a that have spaces like: http://www.site.com/dial the number.aspx I...
1
by: bhaskar321 | last post by:
Hi all, i am new to access could any one tell me how can i eliminate duplicate records from the query Thanks, Bhaskar
3
by: muddasirmunir | last post by:
i want to know what is the fastest way to eliminate dublicate record from file excel/access etc. suppose i have a large database in excel/access with one some with one field some with upto 10....
10
by: maryanncanor | last post by:
hi, Good day. I use Ms Access 2003 to export data from table to TEXTFILE. this is my Actual output: EMP003 Matt Dwayne EMP001 Josh Harnett EMP005 Peter Parker
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.