Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REMOVING BLANK SPACES FROM REPORT?

Status
Not open for further replies.

akasmia

MIS
Apr 12, 2002
30
US
MY DATA IS A SIMPLE SET OF SHORT SENTENCES CHOSEN BY THE USER ON A FORM. THE SHORT SENTENCES ARE STORED IN A TABLE THEN DISPLAYED IN SMALL TEXT BOXES ON THE REPORT. THE PROBLEM IS THAT WHEN A SENTENCE IS NOT CHOSEN ON THE FORM THEN IT BECOMES BLANK ON THE REPORT.
EXAMPLE:
POSSIBLE CHOICES: CHOSEN ITEMS:
1-FARM 1- FARM
2-MACHINE
3-PERSON 3-PERSON
4-TREE
5-PENCIL 5- PENCIL
.. ...
.. ...
ETC.

AS YOU CAN SEE THERE ARE BLANK SPACES ON THE REPORT!. IS THERE A WAY TO REDUCE THE OUTPUT TO
1-FARM
3-PERSON
5-PENCIL
6-..... etc ?
AK



 
Have you tried setting the Can Shrink property to Yes? If you have fields with names like Farm, Machine,... then I believe your table structure might be somewhat un-normalized.

Duane
MS Access MVP
 
Another method is to develop the contents of the output control (which should be in a group footer) in the detail section (which has visible set to false), and then print the footer.

For each record where the value is the same for the column that defines the user (or whatever it is that the user chooses the values for), in the detail record you create something like this (assuming txtOutput is the control in the footer and txtValue is the control in the detail area where the value is contained):

If me.txtValue > " " then
If isnull(me.txtOutput) then
me.txtOutput = me.txtValue
Else
me.txtOutput = me.txtOutput & vbNewLine & me.txtValue
End If
End If

Be sure to reset txtOutput to Null in the group header (which also can have Visible property set to False) so when you go to the next set of records it will have nothing in it.

txtOutput should be a short height control box with the Can Grow property set to true.

You may have to tweak this code a bit, but basically vbNewLine is an internal variable that contains the code to go to a new line in a text printout.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top