J
Jac Tremblay
Hi,
I have a form with three option buttons. Each of them has a specific
procedure that runs when the user clicks it. These procedures activate or
disable some fields according to some specifications.
Now when the user navigates from record to record, I want the fields to
display as they were when they were set in the first place, hidden, disabled,
etc. For that, I use the form's current event. But when I try to set the
focus to some option button, I get an error message saying that this can't be
done.
To prevent this error and to get the job done, I tried to execute the
procedure that executes when the option button is clicked. It works.
Is that normal?
I use Access 2003, but at the office, they still have Access 2000 and the
form's current event doesn't even fire. Is that a bug in Access 2000 or an
installation problem?
Here is the code I use:
' **********************************
Private Sub Form_Current()
Me.SetFocus
If Me.TypeDeFumeur = 1 Then
Me.optNonFumeurÀVie.SetFocus
ElseIf Me.TypeDeFumeur = 2 Then
Me.optFumeurACessé.SetFocus
ElseIf Me.TypeDeFumeur = 3 Then
Me.optFumeur.SetFocus
End If
End Sub
' **********************************
Thanks.
I have a form with three option buttons. Each of them has a specific
procedure that runs when the user clicks it. These procedures activate or
disable some fields according to some specifications.
Now when the user navigates from record to record, I want the fields to
display as they were when they were set in the first place, hidden, disabled,
etc. For that, I use the form's current event. But when I try to set the
focus to some option button, I get an error message saying that this can't be
done.
To prevent this error and to get the job done, I tried to execute the
procedure that executes when the option button is clicked. It works.
Is that normal?
I use Access 2003, but at the office, they still have Access 2000 and the
form's current event doesn't even fire. Is that a bug in Access 2000 or an
installation problem?
Here is the code I use:
' **********************************
Private Sub Form_Current()
Me.SetFocus
If Me.TypeDeFumeur = 1 Then
Me.optNonFumeurÀVie.SetFocus
ElseIf Me.TypeDeFumeur = 2 Then
Me.optFumeurACessé.SetFocus
ElseIf Me.TypeDeFumeur = 3 Then
Me.optFumeur.SetFocus
End If
End Sub
' **********************************
Thanks.