G
Guest
hi, good day.
i have made 2 toggle buttons toggling each other when clicked respectively.
here is its newbie code:
Private Sub Toggle20_Click()
If Toggle21 Then
Toggle21 = False
Toggle20 = True
Else
Toggle21 = True
Toggle20 = False
End If
End Sub
Private Sub Toggle21_Click()
If Toggle20 Then
Toggle20 = False
Toggle21 = True
Else
Toggle20 = True
Toggle21 = False
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
Toggle21 = True
Toggle20 = False
End Sub
i have used this code before and it worked on common circumstances.
in my problem, i made a continuous form and have set its allow additions
property to No. the toggle buttons are located at the form footer. in this
situtation, my code only works when the form already contains records. if i
clear the records and open it in form view (e.g. new list of the new day),
only the toggle button that i clicked will be pressed down or up. meaning,
the code was not executed.
it sure works again if i set the allow additions property to Yes. but i
dont want it to allow additions coz i want the form as a list only. i have
set its controls read only.
what did i miss? any recommendations?
thanks.
i have made 2 toggle buttons toggling each other when clicked respectively.
here is its newbie code:
Private Sub Toggle20_Click()
If Toggle21 Then
Toggle21 = False
Toggle20 = True
Else
Toggle21 = True
Toggle20 = False
End If
End Sub
Private Sub Toggle21_Click()
If Toggle20 Then
Toggle20 = False
Toggle21 = True
Else
Toggle20 = True
Toggle21 = False
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
Toggle21 = True
Toggle20 = False
End Sub
i have used this code before and it worked on common circumstances.
in my problem, i made a continuous form and have set its allow additions
property to No. the toggle buttons are located at the form footer. in this
situtation, my code only works when the form already contains records. if i
clear the records and open it in form view (e.g. new list of the new day),
only the toggle button that i clicked will be pressed down or up. meaning,
the code was not executed.
it sure works again if i set the allow additions property to Yes. but i
dont want it to allow additions coz i want the form as a list only. i have
set its controls read only.
what did i miss? any recommendations?
thanks.