By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

Print Security

P: 54
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....
Mar 20 '07 #1
Share this Question
Share on Google+
9 Replies


P: 54
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
Mar 20 '07 #2

Rabbit
Expert Mod 10K+
P: 12,347
Create a non-visible Label and use:
Expand|Select|Wrap|Line Numbers
  1. Dim rst As Recordset
  2. Set rst = CurrentDb.OpenRecordset(recordset of report)
  3. If rst.RecordCount = 0 Then
  4.    LabelName.Visible = True
  5. End If
Mar 20 '07 #3

P: 54
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
Mar 21 '07 #4

P: 54
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.openrecordset(recordset of report)

should i put the script on the form right? thanks
Mar 21 '07 #5

Rabbit
Expert Mod 10K+
P: 12,347
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.
Mar 21 '07 #6

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

NeoPa
Expert Mod 15k+
P: 31,342
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 PageHeaderSection).
  4. In the right-hand one select Format.
  5. Paste the following procedure in.
Expand|Select|Wrap|Line Numbers
  1. Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
  2.     Me.YourLabel.Visible = (Not Me.HasData)
  3. 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
Mar 21 '07 #8

P: 54
Thanks NEoPA and Rabbit for the big help it works smooth and properly...Thanks again
Mar 22 '07 #9

Rabbit
Expert Mod 10K+
P: 12,347
Not a problem, good luck.
Mar 22 '07 #10

Post your reply

Sign in to post your reply or Sign up for a free account.