This article was previously published under Q200550
Advanced: Requires expert coding, interoperability, and multiuser skills.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.
View products that this article applies to.
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
Keywords: KB200550, kbvba, kbprogramming, kbofficeprog, kbinfo, kbdta