I currently have this code that opens a form when the button is pushed,
I am wanting to add a line of code to this string that also deletes a record from a specified table. How would I go about doing that?
Code:
Private Sub cmdWorkOrder_Click()
On Error GoTo Err_cmdWorkOrder_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "New WorkOrder"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms![New WorkOrder].[Description of Work Performed] = Me.txtReasonCode
Exit_cmdWorkOrder_Click:
Exit Sub
Err_cmdWorkOrder_Click:
MsgBox Err.Description
Resume Exit_cmdWorkOrder_Click
End Sub
I am wanting to add a line of code to this string that also deletes a record from a specified table. How would I go about doing that?