Print Security

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hexagram
    New Member
    • Feb 2007
    • 54

    Print Security

    Hi guys good day, can anybody help me to solve my problem this is the scenario:

    All the forms must be filled up completely before printing,
    The administrator want to have security in all reports,
    the condition is if the user will attempt to print a blank report it will be printed but their will be a bold font in a report saying its just a "SAMPLE REPORT" so that all the reports will not be forge manually by the user, they must filled up the report by using forms, my Control ID is nature by Autonumber.... thanks in advance....
  • hexagram
    New Member
    • Feb 2007
    • 54

    #2
    Hi guy i think its not much clear for you guys about my problems bacause i dont get any reply from you so i reconstruct my wording

    this my problem i have different forms with different reports i want is if the user
    is attempting to print a blank report i will allow to print but i want to put on that report a big bold word "FOR SAMPLE REPORTS ONLY" so that the user cant forge the report manually because i want all the reports to filled up by its form hope its kinda clear for now i need some idea how to do it thanks in advance

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      Create a non-visible Label and use:
      Code:
      Dim rst As Recordset
      Set rst = CurrentDb.OpenRecordset([i]recordset of report[/i])
      If rst.RecordCount = 0 Then
         LabelName.Visible = True
      End If

      Comment

      • hexagram
        New Member
        • Feb 2007
        • 54

        #4
        Hi rabbit i tried the code uve given to me but i encounter some errors

        " Compile Error : Expected: list separator or ),

        should i put the script on the form right? thanks

        Comment

        • hexagram
          New Member
          • Feb 2007
          • 54

          #5
          Hi rabbit i tried the code uve given to me but i encounter some errors

          " Compile Error : Expected: list separator or ), The error pointing to the
          Set rst = Currentdb.openr ecordset(record set of report)

          should i put the script on the form right? thanks

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            You should put it in your On Open event of the report and you'll have to rename some of the things. If you did all this, post your code and we'll take a look.

            Comment

            • hexagram
              New Member
              • Feb 2007
              • 54

              #7
              hi rabbit i cant find the do open event in the report where can i see that? sori im new in access : (

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32633

                #8
                Try this (It can't be done in the report's Open procedure as the property has not been set yet - at that point) :
                1. Open your report in Design View.
                2. Use Alt-F11 to open the VBA Window.
                3. Near the top of the code pane you will see two drop-down boxes. In the left one, select your Page Header (probably called PageHeaderSecti on).
                4. In the right-hand one select Format.
                5. Paste the following procedure in.

                Code:
                Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
                    Me.YourLabel.Visible = (Not Me.HasData)
                End Sub
                This should create a procedure for you. Remember to change "YourLabel" to the actual name of your label. Don't forget, I don't know what you've called the label that Rabbit got you to set up as you haven't told us :s

                Comment

                • hexagram
                  New Member
                  • Feb 2007
                  • 54

                  #9
                  Thanks NEoPA and Rabbit for the big help it works smooth and properly...Than ks again

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #10
                    Not a problem, good luck.

                    Comment

                    Working...