S
Steve G
Hi All:
Well, I have managed to stump myself again.
I have a form that prints a report when a command button is clicked.
Now I need to update a field in a table in the database when this button is
clicked, as well as printing the report. This is the code I am using to
print the report:
Private Sub Please_Print_This_Form_Click()
On Error GoTo Err_prntDispForm_Click
Me.Dirty = False
Dim stDocName As String
Dim strFilter As String
stDocName = "rptDispForm"
strFilter = "ID = Forms!frmDelivery!ID"
DoCmd.OpenReport stDocName, acNormal, , strFilter
Exit_prntDispForm_Click:
Exit Sub
Err_prntDispForm_Click:
MsgBox Err.Description
Resume Exit_prntDispForm_Click
End Sub
I need to do this as well:
UPDATE Orders LEFT JOIN Printed ON Orders.ID = Printed.OrderID SET
Printed.Printed = "Yes"
WHERE (((Orders.ID)=[ID]));
Any ideas would, as always, be much appreciated.
Steve G
Well, I have managed to stump myself again.
I have a form that prints a report when a command button is clicked.
Now I need to update a field in a table in the database when this button is
clicked, as well as printing the report. This is the code I am using to
print the report:
Private Sub Please_Print_This_Form_Click()
On Error GoTo Err_prntDispForm_Click
Me.Dirty = False
Dim stDocName As String
Dim strFilter As String
stDocName = "rptDispForm"
strFilter = "ID = Forms!frmDelivery!ID"
DoCmd.OpenReport stDocName, acNormal, , strFilter
Exit_prntDispForm_Click:
Exit Sub
Err_prntDispForm_Click:
MsgBox Err.Description
Resume Exit_prntDispForm_Click
End Sub
I need to do this as well:
UPDATE Orders LEFT JOIN Printed ON Orders.ID = Printed.OrderID SET
Printed.Printed = "Yes"
WHERE (((Orders.ID)=[ID]));
Any ideas would, as always, be much appreciated.
Steve G