Article ID: 200550
Article Last Modified on 10/11/2006
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
Additional query words: dialog confirm
Keywords: kbdta kbinfo kbofficeprog kbprogramming kbvba KB200550