Question A way in which to hide certain information ?

trizzytt

Registered User.
Local time
Yesterday, 21:26
Joined
Sep 27, 2017
Messages
19
Hello,

While i have my database i would like to be able to print out certain pages, on some pages i would like to have information that can only be seen on the computer and not when i print. Is there a way in which you can do this, as i want to be able to put on my page the profits i have made for the order but not show this to the customer when i print the invoice for them.


Many thanks.
 
Is this information that is only calculated/should only be displayed when the report is run?

IF yes; you can total as your report processes and open a form displaying the results (or use MsgBox to do it).

IF no; Id' set up a query that generates your calculated fields and display them on a form you can open any time you need.

If you need something else or more detailed instructions please let us know.
 
Hello,

While i have my database i would like to be able to print out certain pages, on some pages i would like to have information that can only be seen on the computer and not when i print. Is there a way in which you can do this, as i want to be able to put on my page the profits i have made for the order but not show this to the customer when i print the invoice for them.

Many thanks.

Yes you can do this - select the controls you want to hide when printing the report, go to the property sheet and set as
Code:
Display When = Screen Only

See screenshot below

attachment.php
 

Attachments

  • Capture.jpg
    Capture.jpg
    62.6 KB · Views: 300
ridders that's perfect! Many thanks., just what I needed
 
You're welcome

Another technique I sometimes use is to make the same report available in different versions
- all data visible
- selected data hidden e.g. personal data removed to make the report anonymous - useful for meetings either in printed format or on screen using a data projector or of course for posting to a forum!!!!

attachment.php


So that's effectively 3 options but I don't want to create 3 different reports so I do it using VBA.

Before opening the report in print preview,the user decides whether it should be anonymised. If so, a boolean AnonFlag is set = true

Then in the report, I use code similar to this adapting the items to be hidden for each report

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If AnonFlag = True Then
    Me.PupilID.visible = False
    Me.Forename.visible = False
    Me.Surname.visible = False
    Me.txtTG.visible = False
    Me.lblAnon.visible = True
Else
    Me.PupilID.visible = True
    Me.Forename.visible = True
    Me.Surname.visible = True
    Me.txtTG.visible = True
    Me.lblAnon.visible = False
End If

End Sub

It can be made even easier to code by setting the tag value for all items to be hidden as say ANON

Then loop through the controls using code to set visible = False where Tag="ANON"
 

Attachments

  • Capture.PNG
    Capture.PNG
    52.9 KB · Views: 257
Last edited:
This is perfect information, thank you all!
 

Users who are viewing this thread

Back
Top Bottom