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

Skip display of lines if... 1

Status
Not open for further replies.

acent

Technical User
Feb 17, 2006
247
US
I'm creating a report on our inventory levels. Therefore I have the following fields:
part
description
stocklevel
onhand
need
onorder
toorder

toorder=stocklevel+onhand-need-onorder

Now, if toorder <= 0 I do't want anything displayed. I was hoping someone could point me in the right direction on this one.

Thanks,

Andrew

"If you say you can, or you say you can't, you're right!"
-- Henry Ford
 
VBA for the report will do nicely.

I dont know what section toorder is in, but if its in the Details section you can do the following:

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
     If Me![ToOrder] <= 0 Then
          txtToOrder.Visible = False
     Else
          txtToOrder.Visible = True
     End If
End Sub

Just name the textbox that toorder is usually displayed in on the report to txtToOrder and that code should work for you. =]


-Pete
 
Thanks snyperx3 for the fast reply! A small modification to that and it worked beautifully:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me.toOrder_txt <= 0 Then
        Me.Detail.Visible = False
    Else
        Me.Detail.Visible = True
    End If
End Sub

This caused all the fields in the detail (which is where they were) to not be displayed thereby skipping the whole line and shorting the report from 12 pages down to 4.

Thanks Again!

"If you say you can, or you say you can't, you're right!"
-- Henry Ford
 
Ah, sorry for the misunderstanding. I didn't read well enough. =]

Glad i could help and you could get it to work.

-Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top