Ask Experts Questions for FREE Help !
Ask
    ecanestrari's Avatar
    ecanestrari Posts: 6, Reputation: 1
    New Member
     
    #1

    Aug 29, 2014, 02:08 AM
    "Cancel" Action - Reason required
    Hi there,

    I have different forms that are linked to one table (tblDeals) in which I have several fields but in this case I'm interested in two of them ("Status" and "Reason").

    On the forms I have a combo box with two values: "Active" and "Cancelled". What I want is that when the "Status" is changed a pop up message appears that will require the user to enter the reason why he changed the status and that information should be saved in the field "Reason".

    I know is an Afterupdate event and I'm using the InputBox function but not managing to get it working properly and for the field "Reason"

    Thanks in advance,

    Regards,
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    Aug 29, 2014, 04:26 AM
    That's not the way I would do it. Have a control bound to the Reason field on your form. In the After Update event of the Status combo use this line of code:

    Me.Reason.SetFocus

    Assuming reason is the name of control bound to the Reason field.

    In the Lost Focus event of that control pit code like:

    If IsNull(Me.Reason) Then
    MsgBox "You must enter a reason!"
    Me.Reason.SetFocus
    End If

    So when the user changes the status, the Reason control gets the focus. If the user tries to exit the control without entering a reason, they will be told to do so and focus put back in the control. So they won't be able to exit the control without entering a reason.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

They cancel my friend visa for no reason he took his kids for their visa &denial [ 0 Answers ]

Why would they cancel his visa he never over stay in the US always return back to Jamaica never got in trouble with the law. His visa don't expires until Janury 2013. All he did was take his kids in to get their visa so they could visit their grand mother. They didn't give no reasons. He was so...

How do I alternatively plead an action for quiet title, an action based upon adverse [ 3 Answers ]

How do I plead a cause of action for quiet title based on a boundary dispute and then plead alternatively for title based upon adverse possession and then plead alternatively for prescriptive easement?

Can a us immigration officer cancel a visitor's visa without any reason? [ 4 Answers ]

Providing that the visitor has not broken any immigrations or border protection laws, is a law abiding citizen/visitor and not acted in an unlawful manner, does an immigrations officer have the right to cancel this traveler's visa?

Can he cancel [ 8 Answers ]

I was just wondering if my soon to be ex can cancel my cell phone. We are in divorce proceedings. He has threatened to do it, but never has. I told him he could but since we just renewed our contract that he'd have to pay the early cancellation fee. We have 1400 peak minutes, I have used 637 and he...


View more questions Search