Toggle button (1 Viewer)

AlvaroCity

Registered User.
Local time
Today, 07:40
Joined
Jul 16, 2016
Messages
70
Hello folks!

I've bumped into a problem developing my DB. I've got a form to create quotation reports.

Sometimes I'd like to show the price per unit and others not. So what I've tried was to create a toggle button to change the properties of the report to either display the price unit column or not.
Code:
Reports!Mainreport!UnitPrice!Visible = False

But this code doesn't do anything...

Any ideas?

Thank you very much in advance.
 

isladogs

MVP / VIP
Local time
Today, 07:40
Joined
Jan 14, 2017
Messages
18,209
Where are you using that code?

My approach would be to open the report with different named 'args' depending on the toggle choice made
E.g. DoCmd.OpenReport "ReportName" ,,,,,"MyArgName"

NOTE I'm typing on a phone. Check the number of commas

In your report open event use something like

Code:
private sub Report_Open()

Select Case Me.OpenArgs

Case "Visible"
Me.UnitPrice.Visible=True

Case Else
Me.UnitPrice.Visible=False

End Select

End Sub
 

Users who are viewing this thread

Top Bottom