I have an event setup on the AfterUpdate of an Option Group which hide/unhide a bunch of other fields.
When creating a new record the fields are visible if the previous report I was on had them displayed and I understand that this is because my event is trigged by the AfterUpdate of a field that I have yet not touch on a new record.
Where should I create such event for it to "reset" on a new record?
This is my code:
Code:
Private Sub Substantive_Stds_AfterUpdate()
On Error GoTo Substantive_Stds_AfterUpdate_Err
DoCmd.SetProperty "Selection", acPropertyVisible, "0"
DoCmd.SetProperty "Subs rectangle", acPropertyVisible, "0"
DoCmd.SetProperty "12(1)(a) cb", acPropertyVisible, "0"
DoCmd.SetProperty "12(1)(b) cb", acPropertyVisible, "0"
DoCmd.SetProperty "Character cb", acPropertyVisible, "0"
DoCmd.SetProperty "Poo cb", acPropertyVisible, "0"
DoCmd.SetProperty "12(1)(b) other cb", acPropertyVisible, "0"
DoCmd.SetProperty "12(1)(c) cb", acPropertyVisible, "0"
DoCmd.SetProperty "Confusion cb", acPropertyVisible, "0"
If (Substantive_Stds = 2) Then
DoCmd.SetProperty "Selection", acPropertyVisible, "-1"
DoCmd.SetProperty "Subs rectangle", acPropertyVisible, "-1"
DoCmd.SetProperty "12(1)(a) cb", acPropertyVisible, "-1"
DoCmd.SetProperty "12(1)(b) cb", acPropertyVisible, "-1"
DoCmd.SetProperty "Character cb", acPropertyVisible, "-1"
DoCmd.SetProperty "Poo cb", acPropertyVisible, "-1"
DoCmd.SetProperty "12(1)(b) other cb", acPropertyVisible, "-1"
DoCmd.SetProperty "12(1)(c) cb", acPropertyVisible, "-1"
DoCmd.SetProperty "Confusion cb", acPropertyVisible, "-1"
End If
Substantive_Stds_AfterUpdate_Exit:
Exit Sub
Substantive_Stds_AfterUpdate_Err:
MsgBox Error$
Resume Substantive_Stds_AfterUpdate_Exit
End Sub