J
Julie
I have created a form that by default when opened has
allowedits turned off so that users can 'view' data
without accidentally changing data. To allow users to
udpate data when they need to, I created an option box
with 2 selections (UnLock Data & Lock Data). When unlock
is selected, AllowEdits is updated to true, then when the
user wants to lock the data again to prevent accidental
edits, they select the Lock Data button. The data
actually does lock back up, but the option button does not
repaint, so the selection marker still looks like it is on
the unlock data, even though the data IS locked. I have
tried to repaint the form along with several other things
that just don't work. here is the current code for both
buttons, is there a way to accomplish what i'm trying to
do?
Private Sub LockData_GotFocus()
If Me.Dirty Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70
End If
Form.AllowEdits = False
Form.Repaint
End Sub
Private Sub UnlockData_GotFocus()
Form.AllowEdits = True
End Sub
allowedits turned off so that users can 'view' data
without accidentally changing data. To allow users to
udpate data when they need to, I created an option box
with 2 selections (UnLock Data & Lock Data). When unlock
is selected, AllowEdits is updated to true, then when the
user wants to lock the data again to prevent accidental
edits, they select the Lock Data button. The data
actually does lock back up, but the option button does not
repaint, so the selection marker still looks like it is on
the unlock data, even though the data IS locked. I have
tried to repaint the form along with several other things
that just don't work. here is the current code for both
buttons, is there a way to accomplish what i'm trying to
do?
Private Sub LockData_GotFocus()
If Me.Dirty Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70
End If
Form.AllowEdits = False
Form.Repaint
End Sub
Private Sub UnlockData_GotFocus()
Form.AllowEdits = True
End Sub