Print report from form doesn't show current data

K

Keith

How do I print a report after the data is entered into a form?

Currently, I have a command button running off a macro that saves the
record, but when I print the report its blank. If i go out of the form and
back in I can print. What do I need to put in my macro to make it save and
then print?

My macro is set up this way:
Set Warnings - no
Save - form
OpenReport - where the formid = id
 
K

Ken Snell [MVP]

The Save action in a form does not save the data in the form; its focus is
to save the design of a ofrm or other object. So it's not actually saving
your data, hence the report cannot see the data in the table.

Change the Save action to this:

RunCommand
Command: SaveRecord


Alternatively, this also should work:

SetValue
Item: Forms!NameOfYourForm.Dirty
Expression: False
 
K

Ken Snell [MVP]

The Save action in a form does not save the data in the form; its focus is
to save the design of a ofrm or other object. So it's not actually saving
your data, hence the report cannot see the data in the table.

Change the Save action to this:

RunCommand
Command: SaveRecord


Alternatively, this also should work:

SetValue
Item: Forms!NameOfYourForm.Dirty
Expression: False
 
K

Keith

Perfect. Thank you Ken!!!

Ken Snell said:
The Save action in a form does not save the data in the form; its focus is
to save the design of a ofrm or other object. So it's not actually saving
your data, hence the report cannot see the data in the table.

Change the Save action to this:

RunCommand
Command: SaveRecord


Alternatively, this also should work:

SetValue
Item: Forms!NameOfYourForm.Dirty
Expression: False

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
 
K

Keith

Perfect. Thank you Ken!!!

Ken Snell said:
The Save action in a form does not save the data in the form; its focus is
to save the design of a ofrm or other object. So it's not actually saving
your data, hence the report cannot see the data in the table.

Change the Save action to this:

RunCommand
Command: SaveRecord


Alternatively, this also should work:

SetValue
Item: Forms!NameOfYourForm.Dirty
Expression: False

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
 

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