I have a client that does not want to use the Access navigation buttons. Instead wants to have toggle buttons. On the subform there can be up to 6 children. I have set up the buttons and have the code to turn them on or off as I move from child to child. I have created a subroutine I call TurnOnButton (#) that turns on that button and turns the others off. The values can be 0 (no children) to 6. I also have a text box on the subform called ChildCount that has a control source of =Count(*) that has the number of children already entered.
Here is the problem. When the form is brought up I want to light up either the 0 (if no children are entered) or the 1 if there are any children entered. I can't figure out where to put the code. I have tried to put the code on the On Open or On Current property of the subform, but it appears that the Count is calculated after those events have happened. Where should I put the code? Or is there a better way to approach the problem.
Code being used:
If Me.ChildCount = 0 Then
TurnOnButton (0)
Else
TurnOnButton (1)
End If
Here is the problem. When the form is brought up I want to light up either the 0 (if no children are entered) or the 1 if there are any children entered. I can't figure out where to put the code. I have tried to put the code on the On Open or On Current property of the subform, but it appears that the Count is calculated after those events have happened. Where should I put the code? Or is there a better way to approach the problem.
Code being used:
If Me.ChildCount = 0 Then
TurnOnButton (0)
Else
TurnOnButton (1)
End If