Hi all,
Here is what i have.
A form (Pop up) [frmworkorderrequestnew] to enter data with a submit button
A report [rptnewworkorder] that takes the data from the form (With a query and this in the criteria for workorderid [Forms]![frmWorkOrderRequestNew]![WorkOrderID])
The goal is when the user clicks the submit button it would take the selected record in the form and transfer it to the report. it would then close the form, email the report (from the preview??) then close the preview.
So far i have this...
Which works great but for some reason i am having trouble closing the darn forms and the report from the preview!! i always get an error or they don't close :banghead:
Here is what i have.
A form (Pop up) [frmworkorderrequestnew] to enter data with a submit button
A report [rptnewworkorder] that takes the data from the form (With a query and this in the criteria for workorderid [Forms]![frmWorkOrderRequestNew]![WorkOrderID])
The goal is when the user clicks the submit button it would take the selected record in the form and transfer it to the report. it would then close the form, email the report (from the preview??) then close the preview.
So far i have this...
Code:
Private Sub command531_Click()
Dim strReport As String
strReport = "rptNewWorkOrder"
Me.Refresh
DoCmd.OpenReport strReport, acViewPreview, , "WorkORderid = " & Me!WorkOrderID
DoCmd.SendObject acSendReport, "rptNewWorkOrder", "Format Here", "Email Address Here", , , "Subject Here", "", False
DoCmd.Close acReport, [rptworkorder], acSaveYes
End Sub
Which works great but for some reason i am having trouble closing the darn forms and the report from the preview!! i always get an error or they don't close :banghead: