J
jacecrocker
I have a form with subform /subsubform on one tab and a subform on
another tab control that has a toggle button when on opened they are
not to be modified. You can then press the button to edit. The code I
have now only does this for the main form. I need to be able to add
the subforms to this code. I am not sure how to make this happen.
Pretty new at this stuff. Below is my code that I am using below. I
have tried several things to no avail. Any help would be greatly
appreciated.
Jace
Function ToggleEdit(frm As Form, BEdit As Boolean)
On Error GoTo err_ToggleEdit
'toggle edit and backcolor
If BEdit Then
'Set the focus to the control holding the subform
'Forms!Orders!subControlOrderDetails.SetFocus
With frm
.AllowAdditions = True
.AllowDeletions = True
.AllowEdits = True
.Detail.BackColor = CTeal
End With
Else
With frm
.AllowAdditions = False
.AllowDeletions = False
.AllowEdits = False
.Detail.BackColor = CGrey
End With
End If
exit_ToggleEdit:
Exit Function
err_ToggleEdit:
MsgBox "Err Number " & Str(Err) & ": " & Err.Description
Resume exit_ToggleEdit
End Function
another tab control that has a toggle button when on opened they are
not to be modified. You can then press the button to edit. The code I
have now only does this for the main form. I need to be able to add
the subforms to this code. I am not sure how to make this happen.
Pretty new at this stuff. Below is my code that I am using below. I
have tried several things to no avail. Any help would be greatly
appreciated.
Jace
Function ToggleEdit(frm As Form, BEdit As Boolean)
On Error GoTo err_ToggleEdit
'toggle edit and backcolor
If BEdit Then
'Set the focus to the control holding the subform
'Forms!Orders!subControlOrderDetails.SetFocus
With frm
.AllowAdditions = True
.AllowDeletions = True
.AllowEdits = True
.Detail.BackColor = CTeal
End With
Else
With frm
.AllowAdditions = False
.AllowDeletions = False
.AllowEdits = False
.Detail.BackColor = CGrey
End With
End If
exit_ToggleEdit:
Exit Function
err_ToggleEdit:
MsgBox "Err Number " & Str(Err) & ": " & Err.Description
Resume exit_ToggleEdit
End Function