Hello I'd like to prevent/allow edits and additions to a form by using a toggle button with the code:
Private Sub tglDataEntry_Click()
Dim tf As Boolean
Select Case tglDataEntry.Value
Case True
tglDataEntry.Caption = "All Data"
tf = True
Case False
tglDataEntry.Caption = "Edit Data"
tf = False
End Select
Me.AllowEdits = tf
Me.AllowDeletions = tf
' (do I need a Refresh here)?
End Sub
The only problem is that when when they are toggled off, the form and hence the button is disabled as well.
Can it be done from the form - or do I need to program the ribbon to toggle on and off?
Private Sub tglDataEntry_Click()
Dim tf As Boolean
Select Case tglDataEntry.Value
Case True
tglDataEntry.Caption = "All Data"
tf = True
Case False
tglDataEntry.Caption = "Edit Data"
tf = False
End Select
Me.AllowEdits = tf
Me.AllowDeletions = tf
' (do I need a Refresh here)?
End Sub
The only problem is that when when they are toggled off, the form and hence the button is disabled as well.
Can it be done from the form - or do I need to program the ribbon to toggle on and off?