I have a form with a list on it. When the user double clicks the list it updates a text box on the form. I need to be sure that the user has the option to stop the update if they double clicked the list by accident. The part that isn't working is the code where the msgbox should come up and give the user the choice of changing the data or not.
Code: Select all
Private Sub lstPossibleEmotionalCause_DblClick(Cancel As Integer) 'Checks to see if there is an emotional dx in the corresponding box and asks if it should ne replaced. If IsNull(Me.ClientChosenEmotionalProblemLink) Then Me.txtClientIdentifiedEmotionalCause = txtEmotionalCauseID ElseIf Not IsNull(Me.ClientChosenEmotionalProblemLink) Then If MsgBox("There is already data in the Client Identified Emotional Cause box. Do you wish to replace it", vbYesNo) = vbYes Then 'enter code that should run if the answer is yes Me.txtClientIdentifiedEmotionalCause = txtEmotionalCauseID Else: 'Do Nothing End If End If