Good Morning All;
Is it possible to have a YES/NO msgbox display if a field on a form is equal to a certain value?
On my form; I have a close button with the following code that works fine:
What I would like to do is.. when the close button is clicked; is to show a message box asking do you want to change the status of the record, if the answer is yes; I would like the form to remain open, but if the answer is no then I would like to close the form and run the code above.
I have tried this code so far (5 is equal to Unallocated in my table; as I save the lookup number rather than text in main table):
Unfortunately this errors, would one of you kind people give me a point in the right direction please?
Kind Regards
Tor Fey
Is it possible to have a YES/NO msgbox display if a field on a form is equal to a certain value?
On my form; I have a close button with the following code that works fine:
Code:
DoCmd.Close acForm, "frm_TF_Ben_Main"
Forms!frm_tf_menu!mycaseis.Requery
I have tried this code so far (5 is equal to Unallocated in my table; as I save the lookup number rather than text in main table):
Code:
If Me.TF_Ben_Status = 5 Then
If MsgBox("This record has a status of 'UNALLOCATED', you need to change the status to make this record live! Would you like to change the record status now?", vbQuestion + vbYesNo, "RECORD UNALLOCATED") = vbYes Then
Cancel = True
Else
DoCmd.Close acForm, "frm_TF_Ben_Main"
Forms!frm_tf_menu!mycaseis.Requery
End If
Kind Regards
Tor Fey
Last edited: