I have a service order form where you input service orders. I also have a report that prints out a service order invoice. Is there a way to make a button on the service order form print the service order you are looking at in the form?
lasmith05
Have a query that checks your invoices. One of the columns will be the InvoiceNbr. In the Criteria for that column put [Forms]![frmServiceOrder]![InvoiceNbr] (of course, changing the name of the form and the name of the InvoiceNbr field to whatever your form and fields are named.
In the command button on the Service Order form, put code similar to the following, which I have copied from an Invoice form that I use. Again you will have to change the names to your own...
Private Sub cmdPreviewInvoiceFilter_Click()
On Error GoTo Err_cmdPreviewInvoiceFilter_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim stDocName As String
I've used the method that SteveR77 suggested and it works great, BUT! If I use a macro to open a form for adding a new record I run into a problem. Because the data in the form has not been sent to the table yet (before pushing the print report button), there is not ID for the report query to call upon.
So how do I setup a way (macro perhaps) that took the data in the form, appended it to the table, and THEN have the report print the new record data?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.