Option button not holding focus

tjones

Registered User.
Local time
Today, 02:26
Joined
Jan 17, 2012
Messages
199
I have an option button that when checked opens two fields. That is working. However when you leave the record the check is not holding although the data in the fields stay you have to recheck to make the fields open again.

How do I make the option when check stay checked and the fields visible?

Private Sub Check90_GotFocus()
Me.CPH_Semester.Visible = True
Me.CPH_Year.Visible = True
End Sub
 
Is your check box bound or unbound? Is there other code in another event that effects the Check box?
 
Not sure, it was added to the form by selecting check box and then pulling in the field from the Add existing field sheet
 
This is the wrong event and the wrong code for doing this, You need
Code:
Private Sub Check90_AfterUpdate()
 If Me.Check90 = -1 Then
  Me.CPH_Semester.Visible = True
  Me.CPH_Year.Visible = True
 Else
   Me.CPH_Semester.Visible = False
   Me.CPH_Year.Visible = False
 End If
End Sub

and

Code:
Private Sub Form_Current()
If Me.Check90 = -1 Then
  Me.CPH_Semester.Visible = True
  Me.CPH_Year.Visible = True
 Else
   Me.CPH_Semester.Visible = False
   Me.CPH_Year.Visible = False
 End If
End Sub
Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom