Article ID: 178997
Article Last Modified on 1/22/2007
Public fEditDescription As Boolean
Private Sub Form_Current()
' Lock the Description control for each record.
Me!Description.Locked = True
fEditDescription = False
End Sub
Private Sub Description_KeyDown(KeyCode As Integer, _
Shift As Integer)
' If the field is not flagged for editing, prompt the user
' for confirmation about unlocking the control.
If fEditDescription = False Then
If MsgBox("Do you want to change Description?", _
vbYesNo + vbQuestion + vbDefaultButton2, _
"Confirmation") = vbYes Then
' If the response is Yes, unlock the field
' and flag it as being edited.
Me!Description.Locked = False
fEditDescription = True
End If
End If
End Sub
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: dialog confirm
Keywords: kbcode kbhowto kbprogramming KB178997