macro to print report - it's blank?

T

Tanya

I've created a macro to print a report based on the
current record in the form the user is currently on.I've
attached this macro to a print/command button on the form.
[PRIOR APPROVAL CONTACT INFO]![PA reference code]=[Forms]!
[PRIOR APPROVAL CONTACT INFO1]![PA reference code]
the first is the name of the table and the PA ref code is
a unique number. PA contact info1 is the name of the form.
the report prints out blank when you hit the command
button from the form but if I save the record and then go
back into it and click the print/command button the report
prints correctly with the info.
does anyone know why this will not print the current info
that the user has just entered while still in the form. I
do not want the user to save and close the form and then
go back find that record and then print.
 
K

Ken Snell

I'm not understanding what you have set up here.

[PRIOR APPROVAL CONTACT INFO]![PA reference code]=[Forms]!
[PRIOR APPROVAL CONTACT INFO1]![PA reference code]

The above is not a macro action.

Can you post the macro's entire step sequence?
 
T

Tanya

The statement below is the where condition for the action
openreport. I've tried doing a save action before the
openreport and it still doesn't work.
Basically I want a report to print from the current
record and only print that one current individual's
information while the user is still on the data entry form.
Any idea's --- I am not trained in access and this is the
first one I have had to build from scratch.. One other
idea - I made the report using a wizard... will any
changes I make to a macro automatically transfer to the
already created report or do I have to re-create the
report?
Tanya - (e-mail address removed)
-----Original Message-----
I'm not understanding what you have set up here.

[PRIOR APPROVAL CONTACT INFO]![PA reference code]=[Forms]!
[PRIOR APPROVAL CONTACT INFO1]![PA reference code]

The above is not a macro action.

Can you post the macro's entire step sequence?

--
Ken Snell
<MS ACCESS MVP>

I've created a macro to print a report based on the
current record in the form the user is currently on.I've
attached this macro to a print/command button on the form.
[PRIOR APPROVAL CONTACT INFO]![PA reference code]= [Forms]!
[PRIOR APPROVAL CONTACT INFO1]![PA reference code]
the first is the name of the table and the PA ref code is
a unique number. PA contact info1 is the name of the form.
the report prints out blank when you hit the command
button from the form but if I save the record and then go
back into it and click the print/command button the report
prints correctly with the info.
does anyone know why this will not print the current info
that the user has just entered while still in the form. I
do not want the user to save and close the form and then
go back find that record and then print.


.
 
K

Ken Snell

You haven't posted all of the macro's actions, so I will assume that you're
running an OpenReport action.

The WHERE argument for this action has this syntax:
[FieldName_in_ReportRecordset] = "some value"

Is PA reference code the name of a field in the report's recordsource
table/query? If not, then you must use the field name that is to be filtered
for the report.

Then, if you want to use the form's control's value, use this:
[FieldName_in_ReportRecordset] = [Forms]![PRIOR APPROVAL CONTACT
INFO1]![PA reference code]

This assumes that the name of your form is PRIOR APPROVAL CONTACT INFO1 and
the control's name is PA reference code.

By any chance, is the record in a subform?

--
Ken Snell
<MS ACCESS MVP>
Tanya said:
The statement below is the where condition for the action
openreport. I've tried doing a save action before the
openreport and it still doesn't work.
Basically I want a report to print from the current
record and only print that one current individual's
information while the user is still on the data entry form.
Any idea's --- I am not trained in access and this is the
first one I have had to build from scratch.. One other
idea - I made the report using a wizard... will any
changes I make to a macro automatically transfer to the
already created report or do I have to re-create the
report?
Tanya - (e-mail address removed)
-----Original Message-----
I'm not understanding what you have set up here.

[PRIOR APPROVAL CONTACT INFO]![PA reference code]=[Forms]!
[PRIOR APPROVAL CONTACT INFO1]![PA reference code]

The above is not a macro action.

Can you post the macro's entire step sequence?

--
Ken Snell
<MS ACCESS MVP>

I've created a macro to print a report based on the
current record in the form the user is currently on.I've
attached this macro to a print/command button on the form.
[PRIOR APPROVAL CONTACT INFO]![PA reference code]= [Forms]!
[PRIOR APPROVAL CONTACT INFO1]![PA reference code]
the first is the name of the table and the PA ref code is
a unique number. PA contact info1 is the name of the form.
the report prints out blank when you hit the command
button from the form but if I save the record and then go
back into it and click the print/command button the report
prints correctly with the info.
does anyone know why this will not print the current info
that the user has just entered while still in the form. I
do not want the user to save and close the form and then
go back find that record and then print.


.
 

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