I currently have a form which has fields in it and I also have two option buttons these option buttons are OPEN and CLOSE. Also I have an update button on the form so for example if the user was to select the option OPEN and then click on the update button the record would be saved. But if the user selects the option CLOSE then clicks on the update button I would like the form to be deleted from the database. I have put the code below of what I think needs to make it work. But now i am getting a error message saying "You entered an expression that has no value"
Can anyone help with this please??
Private Sub cmdJobDetailsUpdate_Click()
Dim answer As Integer
If Me.optJobClose.Value = True Then
answer = MsgBox("Are you sure you want to close this job", vbYesNo, "Update Job Details")
If answer = vbYes Then
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
End If
Else
If Me.optJobOpen.Value = True Then
DoCmd.RunCommand acSaveRecord
End If
End If
End Sub
Can anyone help with this please??
Private Sub cmdJobDetailsUpdate_Click()
Dim answer As Integer
If Me.optJobClose.Value = True Then
answer = MsgBox("Are you sure you want to close this job", vbYesNo, "Update Job Details")
If answer = vbYes Then
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
End If
Else
If Me.optJobOpen.Value = True Then
DoCmd.RunCommand acSaveRecord
End If
End If
End Sub