Hi all, I have a form with a command button to open a report. The user clicks a toggle on the form to select which records to show in the report - 'Delivered' Yes/No.
The subform displays orders which have not been processed using 'Processed' Yes/No, with No in the query criteria.
So what I would like to do is have the user select which orders to send to the report, and when the command button is clicked, update the 'Processed' field for those records to 'Yes, True, -1 etc' and requery the subform to remove those records. They have then been 'Processed'.
Could someone give me a little help with how to do this?
I would also like to add a warning dialog to the button like 'This will send selected orders for delivery and remove them from this form,are you sure you wish to continue?' Ok/Cancel. But I'm not sure how to do this either.
Here's all I have so far:-
Many thanks for any help!
The subform displays orders which have not been processed using 'Processed' Yes/No, with No in the query criteria.
So what I would like to do is have the user select which orders to send to the report, and when the command button is clicked, update the 'Processed' field for those records to 'Yes, True, -1 etc' and requery the subform to remove those records. They have then been 'Processed'.
Could someone give me a little help with how to do this?
I would also like to add a warning dialog to the button like 'This will send selected orders for delivery and remove them from this form,are you sure you wish to continue?' Ok/Cancel. But I'm not sure how to do this either.
Here's all I have so far:-
Code:
Private Sub btnOpenDelivRpt_Click()
'Send selected records to delivery report.
If Me!txtSelected = 0 Then
MsgBox "Please select an Order to print", vbOKOnly, "Error"
Else
DoCmd.OpenReport "rptOrderDeliveries", acViewPreview
End If
Exit Sub
End Sub
Many thanks for any help!