How to reset field after msgbox response

K

Keri in Vermont

I have a drop down field where a choice is made - below "Request = 37". Then
the next field is an option box with 4 choices. This is the code for one
choice [call it 'A']. If they click here with the above previous choice,
then they have a decision. If they choose to keep the answer, they can & it
goes on - that works. If they realize they made a mistake and choose 'no'
then I need to allow them to make another choice ['B', 'C', or 'D'].

I have the following code:

If Request = 37 Then
response = MsgBox("Please double check that an appeal was actually filed
for this case. Do you want to keep this answer?", vbYesNo)
If response = vbYes Then Exit Sub
If response = vbNo Then ??this is where I need help??
End If

At the above "??" text, how do I allow them to be able to choose a different
answer?

THANK YOU
 
F

fredg

I have a drop down field where a choice is made - below "Request = 37". Then
the next field is an option box with 4 choices. This is the code for one
choice [call it 'A']. If they click here with the above previous choice,
then they have a decision. If they choose to keep the answer, they can & it
goes on - that works. If they realize they made a mistake and choose 'no'
then I need to allow them to make another choice ['B', 'C', or 'D'].

I have the following code:

If Request = 37 Then
response = MsgBox("Please double check that an appeal was actually filed
for this case. Do you want to keep this answer?", vbYesNo)
If response = vbYes Then Exit Sub
If response = vbNo Then ??this is where I need help??
End If

At the above "??" text, how do I allow them to be able to choose a different
answer?

THANK YOU

By cancelling the record entry.
Use the Form's BeforeUpdate event. It has a Cancel argument.

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Request = 37 Then
If MsgBox("Please double check that an appeal was actually filed
for this case. Do you want to keep this answer?", vbYesNo) = vbNo
Then Cancel = True
End If
End If
End Sub

If the user clicks no, the record update will be canceled, otherwise
the record will be updated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top