Need help on checkbox
Hi everyone,
Need help on checkbox. I have a form and a subform which is bounded to the main form. In the subform, I have checkbox. The question is : I want the user check at least on one checkbox before Exit the database. Is it possible? I have written some codes and it verifie only the first record in the subform. The code below works only when you have an no null on the first record.
Thanks,
Le
Here is my code:
-------------------------------------
Private Sub cmdExit_Click()
If MsgBox("Do you wish to save the changes and Exit ?", vbQuestion + vbYesNo) = vbYes Then
If (Me.subfrmTPMReqUpdate.Form.chbReqTPMRel) = 0 Then
MsgBox " You have to check at least on one requirement.", vbExclamation
Else
MsgBox " Data have saved!"
DoCmd.Close acForm, "frmClientUpdate"
End If
End If
End Sub
Hi everyone,
Need help on checkbox. I have a form and a subform which is bounded to the main form. In the subform, I have checkbox. The question is : I want the user check at least on one checkbox before Exit the database. Is it possible? I have written some codes and it verifie only the first record in the subform. The code below works only when you have an no null on the first record.
Thanks,
Le
Here is my code:
-------------------------------------
Private Sub cmdExit_Click()
If MsgBox("Do you wish to save the changes and Exit ?", vbQuestion + vbYesNo) = vbYes Then
If (Me.subfrmTPMReqUpdate.Form.chbReqTPMRel) = 0 Then
MsgBox " You have to check at least on one requirement.", vbExclamation
Else
MsgBox " Data have saved!"
DoCmd.Close acForm, "frmClientUpdate"
End If
End If
End Sub