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

Conditional eliminate lines

Status
Not open for further replies.

myboat

IS-IT--Management
Jan 15, 2002
14
US
I have a report a report that looks like this:
Detail section

qty price cost
1 1.00 $1.00
2 .75 $1.50
--------------------
Sub Total $2.50
shipping .30
Boxes 1.00
--------------------
Total 3.80

My problem is sometimes, I don't want to charge and display Shipping and Box charges and just print the total. I have tried the Shrink with little success.

Any suggestions?

Thanks

Jim
 
What values are in the Shipping and Box fields when you don't want to display them? Are they null or 0 or what?

I assume you want to remove the labels also.

Is all of what you are displaying above in the Detail section as your question suggests?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Duane, Yes, I want don't want to print the values and labels...the whole 2 lines. The values are zero. I can easily determine which customer doesn't want these one or two items to print. It can be both or one or the other.

I can put the totals in the detail or footer section. I've tried both using the shrink with no success.

Thanks for the quick response to help me out.

Jim
 
You can set the control source of the text boxes to something like:
=IIf(Nz([Shipping],0) = 0, Null, [Shipping])
Change the labels to text boxes with control sources something like:
=IIf(Nz([Shipping],0) = 0, Null, "Shipping:")
Set all text boxes to Can Shrink: Yes.


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Duane, what am I doing wrong. I've set the detail section can grow and shrink to yes, plus all the fields. But I still get blank lines. Here is my code
If Me![PrintHydrorate] = False Then
Me!Label403.Visible = False
Me!HydroCost.Visible = False
Me.HydroCoolRate.Visible = False
Me!txtsubtotal = Me!Text324 - Me!HydroCost
Me!HydroCoolRate.Height = 0
Me!HydroCost.Height = 0
Me!Label403.Height = 0
Reports![rptDaily Invoices Not MT Special].HydroCoolRate.Height = 0
Reports![rptDaily Invoices Not MT Special].HydroCost.Height = 0
Reports![rptDaily Invoices Not MT Special].Label403.Height = 0
End If
 
I suggested a no code solution. Did you try it or was I wasting my time?

What is [PrintHydrorate]? Is this something you are using to determine whether or not to display something rather than looking at the value of shipping and boxes?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Duane, I apologies. I don't mean to waste your time and very much appreciate your help.

[PrintHydrorate] is a yes/no field. If it is No, I don't want to print out the line. The values would be zero. I would want the total line to "move" to eliminate the blank lines.

Thanks again
 
Then abandon any code. You can set the control source of the text boxes to something like:
=IIf(Nz([PrintHydrorate],0) = 0, Null, [Shipping])

Change the labels to text boxes with control sources something like:
=IIf(Nz([PrintHydrorate],0) = 0, Null, "Shipping:")

Set all text boxes to Can Shrink: Yes
Set the section containing the text boxes to Can Shrink: Yes


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Duane, sorry it took so long to get back to you on this thread, but your solutoin worked!.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top