Hello, I need to suppress printing detail lines with a certain transaction type...I have TAX transactions I do not want to print but I will still total them...any help would be appreciated
Not a VB guy but tried this and nothing happened...I would suggest that you place code in the Detail Section's On Format event to hide the section (visible = false) for the records you do not want to print.
I would suggest that you place code in the Detail Section's On Format event to hide the section (visible = false) for the records you do not want to print.
Almost thereYou need to call the control's visible property and also need to make visible if it doesn't meet the condition.
Code:If Me.Tax <> 0 Then Me.Visible = False Else Me.Visible = True End If
What is the Tax value you don't want to show? Anything that is not 0?
Revised code:
Code:If Me!Tax <> 0 Then Me.Visible = False Else Me.Visible = True End If
If Me!Tax > 0 Then
Control1.Visible = False
Control2.Visible = False
... etc
Else
Control1.Visible = True
Control2.Visible = True
... etc
End If
How many controls have you got on the Detail section that needs to be hidden?
You can't suppress a whole section, so you would need to hide each control:
Code:If Me!Tax > 0 Then Control1.Visible = False Control2.Visible = False ... etc Else Control1.Visible = True Control2.Visible = True ... etc End If
If there are many controls then there is a quicker way.
Same code as before but for the IF statement you should be checking against TRANS TYPE.
IF Me![TransType] = "Tax" Then
... etc
Change it to the name of the Trans Type field.
Glad to know you're learning
Remember that the control (i.e. the text box) may be called TransType but is the field actually called TransType? Check that to confirm. Once you've done that ensure that you amend the code. Also use this instead:
If Trim(Ucase(Me!TransType)) = "tax" Then
Find attached. See if you can spot what was amended![]()
It's not visible on mine. What version of Access are you using?