vba printing

E

ewroldsen

I reciently took over this DB and need to be able to print the filtered
records.
the code below will only print the single record based on the commercialID

this sub calls a 2nd form to do the printing.

any help would be appreciated.
Thanks

Private Sub btnPrintAll_Click()
On Error GoTo Err_btnPrintAll_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Dim stDocName As String
Dim MyForm As Form

stDocName = "CommercialPrint"
Set MyForm = Screen.ActiveForm


intID = CommercialID.Value

DoCmd.OpenForm stDocName, acNormal, , "CommercialID = " & intID,
acFormEdit, acHidden
DoCmd.SelectObject acForm, stDocName, False
Screen.ActiveForm.Printer.Orientation = acPRORPortrait
DoCmd.PrintOut acSelection
DoCmd.Close acForm, stDocName, acSaveNo


Exit_btnPrintAll_Click:
Exit Sub

Err_btnPrintAll_Click:
MsgBox Err.Description
Resume Exit_btnPrintAll_Click

End Sub
 

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