Remove print on Report preview

H

HappyBlue

Is it possible to remove the "Print" function for a report in preview mode?

I am printing an invoice and want any print-outs to be done from a button as
this adds information such as "date printed" and so on. However, users can
preview the report and print that out which means there is no "date printed"
added.

Can anyone help?

Thanks in advance
 
B

biganthony via AccessMonster.com

Can't you put a textbox in the footer of the report that has: =Now() in it.
When the report is printed from the print preview screen, the date and time
of printing is stamped on the footer.
 
H

HappyBlue

Thanks for your response.

I need to have a "printed on" date as the date that the report was first
printed and so is the date that the invoice is sent to the customer. This is
stored in a table and after it's set first time, is not changed on any futute
prints.

Another option, if it's possible, would be to add the "date printed" data
from the normal print button, but I can't see how that can be done either!

Help?!?!?!
 
B

biganthony via AccessMonster.com

What about creating a label on the report that prints the date from the table
by using dlookup? Such as:

lblname.caption = dlookup("[PrintedonDate]","tblTableName")

"PrintedonDate" is the name I used for that field you said holds the date.
tblTableName is the anme of the table that holds the above field.
lblname is the label on the report.

Thanks for your response.

I need to have a "printed on" date as the date that the report was first
printed and so is the date that the invoice is sent to the customer. This is
stored in a table and after it's set first time, is not changed on any futute
prints.

Another option, if it's possible, would be to add the "date printed" data
from the normal print button, but I can't see how that can be done either!

Help?!?!?!
Can't you put a textbox in the footer of the report that has: =Now() in it.
When the report is printed from the print preview screen, the date and time
[quoted text clipped - 10 lines]
 
R

Rob Parker

It won't work using a label control. It could work using a textbox, which
can display the result of the dlookup expression.

Rob

biganthony via AccessMonster.com said:
What about creating a label on the report that prints the date from the
table
by using dlookup? Such as:

lblname.caption = dlookup("[PrintedonDate]","tblTableName")

"PrintedonDate" is the name I used for that field you said holds the date.
tblTableName is the anme of the table that holds the above field.
lblname is the label on the report.

Thanks for your response.

I need to have a "printed on" date as the date that the report was first
printed and so is the date that the invoice is sent to the customer. This
is
stored in a table and after it's set first time, is not changed on any
futute
prints.

Another option, if it's possible, would be to add the "date printed" data
from the normal print button, but I can't see how that can be done either!

Help?!?!?!
Can't you put a textbox in the footer of the report that has: =Now() in
it.
When the report is printed from the print preview screen, the date and
time
[quoted text clipped - 10 lines]
Thanks in advance
 
H

HappyBlue

This isn't what I'm after, but if I tell you what I've got, you'll understand
why :)

I have got three buttons on a form, one for "view", one for "e-mail" and one
for "print". Thhe first time that the report (invoice) is printed from the
"print" button, a field is written that creates a "Printed on" date. This is
then the Invoice date that must remain fixed at the first date as it is an
invoice date. The creation of this date happens when my "print" button is
pressed.

On subsequent prints, this date is not changed. On the report I show this
Invoice date (which is essentailly what has been suggested below) as well as
the current date if it's different (on subsequent prints). If the invoice is
emailed, I have a similar process.

The problem is that uers are opening the invoice in "View" and then printing
from the preview. When they do this, there is no way I can see to fire an
event that will create the invoice date, so they are sending invoices without
an initial invoice date. I want to be ableto capture this problem, or stop
it from being able to happen. My initial thought was to simply (if only!)
disable the default "Print" button from the report preview, but if there are
other options, I'll try those :)

Thanks for your continued help.


Rob Parker said:
It won't work using a label control. It could work using a textbox, which
can display the result of the dlookup expression.

Rob

biganthony via AccessMonster.com said:
What about creating a label on the report that prints the date from the
table
by using dlookup? Such as:

lblname.caption = dlookup("[PrintedonDate]","tblTableName")

"PrintedonDate" is the name I used for that field you said holds the date.
tblTableName is the anme of the table that holds the above field.
lblname is the label on the report.
 
R

Rick Brandt

HappyBlue said:
This isn't what I'm after, but if I tell you what I've got, you'll
understand why :)

I have got three buttons on a form, one for "view", one for "e-mail"
and one for "print". Thhe first time that the report (invoice) is
printed from the "print" button, a field is written that creates a
"Printed on" date. This is then the Invoice date that must remain
fixed at the first date as it is an invoice date. The creation of
this date happens when my "print" button is pressed.

On subsequent prints, this date is not changed. On the report I show
this Invoice date (which is essentailly what has been suggested
below) as well as the current date if it's different (on subsequent
prints). If the invoice is emailed, I have a similar process.

The problem is that uers are opening the invoice in "View" and then
printing from the preview. When they do this, there is no way I can
see to fire an event that will create the invoice date, so they are
sending invoices without an initial invoice date. I want to be
ableto capture this problem, or stop it from being able to happen.
My initial thought was to simply (if only!) disable the default
"Print" button from the report preview, but if there are other
options, I'll try those :)

Thanks for your continued help.

In most serious apps you remove access to all of the built in menus and toolbars
and build your own and decide where they are displayed. Going that route you
just make sure that the menus and toolbars displayed when a report is in preview
mode do not include any options to print.

You would also need to use the AutoKeys macro to re-assign the <Ctl-P>
combination to some other action other than its normal "Print Options" action.
 
B

biganthony via AccessMonster.com

Rob,

Why won't it work?

I create a label, press the spacebar to create a couple of spaces and then in
the report properties, use DLOOKUP to read the values from the field and
place it in the caption of the label. The caption displays correctly in any
report I have used. Is this programmatically incorrect? I'm not a programmer,
just someone who writes little databases for friends.

Anthony



Rob said:
It won't work using a label control. It could work using a textbox, which
can display the result of the dlookup expression.

Rob
What about creating a label on the report that prints the date from the
table
[quoted text clipped - 27 lines]
 
R

Rob Parker

Hi Anthony,

Seems that this is a side-thread to the OP's question, but nevertheless ...

I don't understand exactly what you mean by "in the report properties, use
DLOOKUP to read the values from the field and place it in the caption of the
label". Are you doing this in code? If so, then yes, you can use a label
control and assign the dlookup result to the caption - something like:
MyLabelControl.Caption = dLookup("Field","Domain","Criteria")
probably in the report's Open event, or perhaps better, in the Format event
of the appropriate section of the report. However, that's not exactly what
you posted - you said to put the dlookup as the label's caption.

I was simply pointing out that a label control, with a dlookup statement
entered directly into its caption entry on the property sheet, will not
display the result of the dlookup - it will display the dlookup statement
itself. On the other hand, if you put the dlookup into a textbox control
(preceded with an = sign) it will display the result of the dlookup
directly.

HTH,

Rob


biganthony via AccessMonster.com said:
Rob,

Why won't it work?

I create a label, press the spacebar to create a couple of spaces and then
in
the report properties, use DLOOKUP to read the values from the field and
place it in the caption of the label. The caption displays correctly in
any
report I have used. Is this programmatically incorrect? I'm not a
programmer,
just someone who writes little databases for friends.

Anthony



Rob said:
It won't work using a label control. It could work using a textbox, which
can display the result of the dlookup expression.

Rob
What about creating a label on the report that prints the date from the
table
[quoted text clipped - 27 lines]
Thanks in advance
 
B

biganthony via AccessMonster.com

Hi Rob,

Sorry my original post was unclear - I was referring to entering the dlookup
command in code in the Report's Open or Format event as you suggest and can
see how what I wrote could be interpreted the other way (which is not what I
wanted!). Sorry - have realised that I used the word "report properties" and
not "Report Events" such as onOpen.

Anthony



Rob said:
Hi Anthony,

Seems that this is a side-thread to the OP's question, but nevertheless ...

I don't understand exactly what you mean by "in the report properties, use
DLOOKUP to read the values from the field and place it in the caption of the
label". Are you doing this in code? If so, then yes, you can use a label
control and assign the dlookup result to the caption - something like:
MyLabelControl.Caption = dLookup("Field","Domain","Criteria")
probably in the report's Open event, or perhaps better, in the Format event
of the appropriate section of the report. However, that's not exactly what
you posted - you said to put the dlookup as the label's caption.

I was simply pointing out that a label control, with a dlookup statement
entered directly into its caption entry on the property sheet, will not
display the result of the dlookup - it will display the dlookup statement
itself. On the other hand, if you put the dlookup into a textbox control
(preceded with an = sign) it will display the result of the dlookup
directly.

HTH,

Rob
[quoted text clipped - 21 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top