A
Alan Z. Scharf
1. I have a Locked field called Active in a contacts database.
2. The The yes/no status of this field is automatically determined by a
stored procedure.
3. Sometimes it is necessary for a user to override the automatically
determined status of the contact.
4. Is it possible to unlock this field with a mouse-click on it?
5. I tried the GotFocus, Enter, Click and MouseDown events, but they don't
respond. No msgbox pops up per code below.
6. Or do I need a separate button to do this?
Thanks.
Alan
Private Sub ActiveManager_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
' Purpose: To override automatic Active setting
Dim strMessage As String
strMessage = ("The Active field is automatically updated with every
bi-weekly Valuation, based on actual holdings in the most recent period." &
BlankLine)
strMessage = (strMessage & "There is no need to change this unless a
manager is now considered Active prior to the next Valuation." & BlankLine)
strMessage = (strMessage & "Are you sure you want to change the Active
status now?")
Response = MsgBox(strMessage, vbYesNo, "Override Active?")
If Response = vbYes Then
Me.Activemanager.Locked = False
Me.Activemanager.ForeColor = 0
Me.Activemanager.SetFocus
End If
End Sub
2. The The yes/no status of this field is automatically determined by a
stored procedure.
3. Sometimes it is necessary for a user to override the automatically
determined status of the contact.
4. Is it possible to unlock this field with a mouse-click on it?
5. I tried the GotFocus, Enter, Click and MouseDown events, but they don't
respond. No msgbox pops up per code below.
6. Or do I need a separate button to do this?
Thanks.
Alan
Private Sub ActiveManager_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
' Purpose: To override automatic Active setting
Dim strMessage As String
strMessage = ("The Active field is automatically updated with every
bi-weekly Valuation, based on actual holdings in the most recent period." &
BlankLine)
strMessage = (strMessage & "There is no need to change this unless a
manager is now considered Active prior to the next Valuation." & BlankLine)
strMessage = (strMessage & "Are you sure you want to change the Active
status now?")
Response = MsgBox(strMessage, vbYesNo, "Override Active?")
If Response = vbYes Then
Me.Activemanager.Locked = False
Me.Activemanager.ForeColor = 0
Me.Activemanager.SetFocus
End If
End Sub