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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress printing line when no input to field 1

Status
Not open for further replies.

grinka

Programmer
Nov 2, 2002
5
US
My printed Access Report looks like this:

text1 text2 text3
text4
text5
(next record)

Text3, text4, and text5 line up under each other, but not in this posting.

Each of the text variables are in one table/one record and input via an Access Form.

When there is no text for text4 and/or text5, I do not want
print lines (blank space) to occur.

I am a novice VBA programmer and Access person. Looking for a solution on the Form properties, or Report Properties or in Code. Thanks for any help.
 
for fields Text4 and Text5, set the CanShrink Property to Yes. That should do it
 
Cityboy3. Thanks for quick response. Either I don't understand or it does not work. I went to text4 and text5, changed their properties Can Shrink to yes. I get:

text1 text2 text3



text1A text2A text3A
text4A


text1B text2B text3B


etc.
The A and B are to indicate new records for purpose of this posting.

Text4, text5, text5A, text4B, and text5B contain no input.
The lines between records do not suppress with Can Shrink = Yes.

As in the original Post the text boxes 3,4,5 line up or report...not on the Post. (I need more experience with Posting).

Perhaps my first posting did not explain my problem correctly. Please help some more. Thanks.




 
Make sure to set the Can Shrink property of the Detail Line as well as of the text boxes.
 
Check out Thread181-397659. It asked almost exactly the same question.

HTH
Lightning
 
Thanks all. Got it to work just fine. Now I have another challenge...to to the same thing with a "Combo Box" selection in the report field. That is, that instead of text3, text4, and text5 being Text data fields, they are the result of selections from a Combo Box....

Report output:
text1 text2 combo3
combo4
combo5
Next record, etc

...wanting to "hide", "suppress", "cancel
print" or whatever when combo4 or combo5 are empty.
 
The combo boxes on your report will still be text boxes, e.g, Text1, Text2, and Text3, but they will have something similar to the following as their Control Source property instead of being bound to a record data field. For Text1:
Code:
=[Forms]![Form1]![Combo1]
For Text2:
Code:
=[Forms]![Form1]![Combo2]
For Text3:
Code:
=[Forms]![Form1]![Combo3]
Replace Form1 with the name of your form that has the combo boxes for user selection. All of the previous discussion of Can Shrink still applies.
 
jfischer, Thanks. Maybe I am not describing my challenge sufficently. Here is what I get when I look at my Report in design view and bring up the Functions on what I called "text3, or text4, or text5" in the posting. (The texts are really ServiceAreaA, SAB, and SAC.)

Label on Property Box:
"Combo Box ServiceAreaX"
control source (field):
"ServiceAreaX"
row source type (field):
"Table/Query"
row source (field):
"SELECT[tblServiceArea].[ServiceArea]FROM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top