From form to report-easy question

C

coronacity

I have a form that has general info and within the form I have a tab control
with more general info. In the tab control I have a button that is to be use
to print a hard copy of that new info.

the problem is that when the button is press the hardcopy (report) comes up
but without the information recently entered. I have to back in the form and
go to another record and go back to the new record then hit the print button
so that the information shows up. In order words how can I "refresh" or
"update" the form so that when I hit the print button (not the microsoft
standard menu print button) the information is there. Thanks in advance
 
A

Al Camp

Coronacity,
Make your own Print Button on the form, and run your report from it...
but... add a Refresh just before the OpenReport function. (Use your own
names)

Private Sub cmdPrintGenInfo_Click()
Refresh
DoCmd.OpenReport "rptMyGenInfo"
End Sub
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
F

fredg

I have a form that has general info and within the form I have a tab control
with more general info. In the tab control I have a button that is to be use
to print a hard copy of that new info.

the problem is that when the button is press the hardcopy (report) comes up
but without the information recently entered. I have to back in the form and
go to another record and go back to the new record then hit the print button
so that the information shows up. In order words how can I "refresh" or
"update" the form so that when I hit the print button (not the microsoft
standard menu print button) the information is there. Thanks in advance

Access does not save newly entered information until you go to the
next record, close the form, close Access, or explicitly tell it to
save the data.
Add one line of code to the command button click event:

DoCmd.RunCommand acCmdSaveRecord
' Then whatever existing code you already have next.
 
C

coronacity

Thank You!

Al Camp said:
Coronacity,
Make your own Print Button on the form, and run your report from it...
but... add a Refresh just before the OpenReport function. (Use your own
names)

Private Sub cmdPrintGenInfo_Click()
Refresh
DoCmd.OpenReport "rptMyGenInfo"
End Sub
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
Top