Access/VBA Library

IsOk

Function to ask the user to confirm an action.

Syntax

IsOk( action )
Parameters
Name Type Description
action String Required. Description of the action which will be performed when user presses the Yes-button.
Return value

Boolean : True when user clicks 'Yes' otherwise False.

Code
Public Function IsOk(action As String) As Boolean

    If MsgBox(action & vbCrLf & vbCrLf & _
                "Are you sure?", _
                vbYesNo Or vbQuestion, _
                "Confirm") = vbYes Then
        IsOk = True
    Else
        IsOk = False
    End If

End Function

Interactiontag:Interaction