Print Report Macro

tuoggy

Registered User.
Local time
Today, 01:38
Joined
Nov 29, 2007
Messages
17
Hey guys,

I got a pretty simple one I think...

I'm using Access 2007 designing a 2000 DB.

I am creating a simple service order db for a client. I have the following:

SERVICE_LOG - Table
ORDER_QUERY - Query
SERVICE_ORDER - Report

I'm currently trying to figure out a way to create a macro that I can put on the form that will take the information entered into the Form and Print it on the Report without having to run the report.

Is there a way to do that?

Basically, what I am asking for is some insight to a macro that will Save the record, Run/Print the Report, and open a new record, and check Yes on the Printed? Field within the SERVICE_LOG table.

I am terrible with Macros, so any help would be appreciated.
 
We have a Form that displays data and when a command button is clicked the Report version of this form, with the same data and including some Unbound text boxes all are in the report.

We created the Form and when all is working Saved it as a Report.

Added the Command Button to the Form to open the Report and added the Filter to the Command Button Code so the data on the Form was also the data the Report Used. No Macro required.

To do what you want, Just add the Update of the Service Log field in your Code on the Command Button.

If this is what you are after, I can paste my code which you should be able to adapt.
 
That sounds like exactly what I am looking for. I was going to make a command button on the form to run the macro when I finished it.

Code would be much appreciated!!!
 
Here is the Form Command Button Code.

Private Sub CmdRptLoansIssuedReport_Click()
On Error GoTo Err_CmdRptLoansIssuedReport_Click

'Filter report to display only Date currently showing on FrmLoansIssuedReport
' (by ReportDate)
DoCmd.OpenReport "RptLoansIssuedReport", acViewPreview, , "TRNACTDTE = #" & Format(Me.ReportDate, "mm/dd/yyyy") & "#"

'Dim stDocName As String

'stDocName = "RptLoansIssuedReport"
'DoCmd.OpenReport stDocName, acPreview

Exit_CmdRptLoansIssuedReport_Click:
Exit Sub

Err_CmdRptLoansIssuedReport_Click:
MsgBox Err.Description
Resume Exit_CmdRptLoansIssuedReport_Click

End Sub

My Filter is a Date.
 
When the Report Opens, It will most likely show all the records.

The Form had a Control text box - unbound, that I entered the date for the Filter to use.

The Report also has the same unbound text box control and this expression is in the Source of the text box property.

=[Forms]![FrmLoansIssuedReport]![ReportDate]

This gets the ReportDate from the form that is still open but no longer displayed.
 

Users who are viewing this thread

Back
Top Bottom