Printing report from form

B

Buthy

I want to print a report based on details in the form. For example, I have
created my own employee report that should print a particular employee
details in the form by pressing print button in the form.
 
C

Crystal

Hi Buthy,

You can use the Where clause of the OpenReport action to
limit the report

ie:

this would go in the OnClick event of your button]

DoCmd.OpenReport "Reportname", acPreview, , _
"EmployeeID=" & nz(me.EmployeeID)

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
B

Buthy

Hi Crystal,

I have tried that and its working fine, but when I press the printpreview
button it asks for employee no parameter. Is it possible to not have
parameter window showing?
--
My Regards,
Buthy


Crystal said:
Hi Buthy,

You can use the Where clause of the OpenReport action to
limit the report

ie:

this would go in the OnClick event of your button]

DoCmd.OpenReport "Reportname", acPreview, , _
"EmployeeID=" & nz(me.EmployeeID)

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com


I want to print a report based on details in the form. For example, I have
created my own employee report that should print a particular employee
details in the form by pressing print button in the form.
 
R

Rick Brandt

Buthy said:
Hi Crystal,

I have tried that and its working fine, but when I press the
printpreview button it asks for employee no parameter. Is it possible
to not have parameter window showing?

Crystal used EmployeeID in her code as an *example*. You have to replace
EmployeeID with whatever field name you are actually using. If you did that
then getting a prompt indicates that you spelled something wrong.
 
B

Buthy

Hi,

I really need help, I have tried many ways but still it's asking for promt?
What to Do?
 
C

Crystal

Hi Buthy,

please post the code you are using to open the report

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
Top