J
johnlute
I use Access 2003. This problem is relative to a continuous form.
I have a subform with toggle buttons. The concept is to click them
when their associated attributes are considered "critical". For
example, I have a field called [IDLength]. It has an "associated"
field called [IDLCritical] which is used to capture the toggle
button's value.
I want the toggle button to be enabled only IF there's a value in
[IDLength] so I devised this AfterUpdate Event:
Private Sub IDLength_AfterUpdate()
Me.tglIDLCritical.Enabled = IsNull(Me.IDLength = True)
Me.tglIDLCritical.Enabled = False = IsNull(Me.IDLength = False)
End Sub
The toggle button's Control Source is [IDLCritical] and here's its
Click Event:
Private Sub tglIDLCritical_Click()
If tglIDLCritical.Value = -1 Then
Me.tglIDLCritical.ForeColor = vbRed
Me.tglIDLCritical.Caption = "YES!"
Me.lblIDL.ForeColor = vbRed
End If
If tglIDLCritical.Value = 0 Then
Me.tglIDLCritical.ForeColor = vbBlack
Me.tglIDLCritical.Caption = "No"
Me.lblIDL.ForeColor = vbBlack
End If
End Sub
All of this works perfectly *when I have the subform opened
independently of its parent form* however when I add it to its parent
form and then open the parent form - it pukes. What happens is that
the toggle buttons are all disabled and only become enabled after I
edit the values in their associated fields. I suppose this makes sense
as they're enabled/disabled according to AfterUpdate Events HOWEVER
why does it all work when the subform's opened independently of the
parent form?
Also, with the parent form opened I will update the value in
[IDLength] for example, and its toggle button will become enabled -
what I want - however if I click the toggle button and then navigate
form the parent record then the toggle button stays depressed! This
does NOT occur with the subform opened independently of the parent
form.
Does anyone have any ideas what I've done wrong?
Thanks for your time and consideration!
I have a subform with toggle buttons. The concept is to click them
when their associated attributes are considered "critical". For
example, I have a field called [IDLength]. It has an "associated"
field called [IDLCritical] which is used to capture the toggle
button's value.
I want the toggle button to be enabled only IF there's a value in
[IDLength] so I devised this AfterUpdate Event:
Private Sub IDLength_AfterUpdate()
Me.tglIDLCritical.Enabled = IsNull(Me.IDLength = True)
Me.tglIDLCritical.Enabled = False = IsNull(Me.IDLength = False)
End Sub
The toggle button's Control Source is [IDLCritical] and here's its
Click Event:
Private Sub tglIDLCritical_Click()
If tglIDLCritical.Value = -1 Then
Me.tglIDLCritical.ForeColor = vbRed
Me.tglIDLCritical.Caption = "YES!"
Me.lblIDL.ForeColor = vbRed
End If
If tglIDLCritical.Value = 0 Then
Me.tglIDLCritical.ForeColor = vbBlack
Me.tglIDLCritical.Caption = "No"
Me.lblIDL.ForeColor = vbBlack
End If
End Sub
All of this works perfectly *when I have the subform opened
independently of its parent form* however when I add it to its parent
form and then open the parent form - it pukes. What happens is that
the toggle buttons are all disabled and only become enabled after I
edit the values in their associated fields. I suppose this makes sense
as they're enabled/disabled according to AfterUpdate Events HOWEVER
why does it all work when the subform's opened independently of the
parent form?
Also, with the parent form opened I will update the value in
[IDLength] for example, and its toggle button will become enabled -
what I want - however if I click the toggle button and then navigate
form the parent record then the toggle button stays depressed! This
does NOT occur with the subform opened independently of the parent
form.
Does anyone have any ideas what I've done wrong?
Thanks for your time and consideration!