I hope you didn't think I meant "you must have" to mean you need to add something. I meant it is a possible reason for why it would not be functioning correctly if that's the case. For me, I still don't understand what the problem is, or even if there is one.then you must have code on one or both of those textboxes and it's interfering with your desired result.
FirstTextBoxName.Visible = (CheckBoxName = True)
SecondTextBoxName.Visible = (CheckBoxName = True)
Select Case True
Case CheckBoxName = True
Me.FirstTextBoxName.Visible = True
Me.SecondTextBoxName.Visible = True
Case CheckBoxName = False
Me.FirstTextBoxName.Visible = False
Me.SecondTextBoxName.Visible = False
End Select
Private Sub Form_Current()
Me.CheckboxName.SetFocus
Call CheckboxName_AfterUpdate()
End Sub
Private Sub Bifare191_AfterUpdate()
'Bifare191
With Me
.Controls("Etichetã194").Visible = Nz(.Controls("Bifare191").Value, 0)
.Controls("Etichetă196").Visible = Nz(.Controls("Bifare191").Value, 0)
.Controls("Combo193").Visible = Nz(.Controls("Bifare191").Value, 0)
.Controls("Text195").Visible = Nz(.Controls("Bifare191").Value, 0)
End With
End Sub
Private Sub Form_Current()
Dim strControlName As String
strControlName = "~"
On Error Resume Next
strControlName = Me.ActiveControl.Name
If InStr("/Combo193/Text195/", strControlName) > 0 Then
Me.Controls("Bifare191").SetFocus
End If
Call Bifare191_AfterUpdate
End Sub
Private Sub Bifare191_AfterUpdate() 'Bifare191 With Me .Controls("Etichetã194").Visible = Nz(.Controls("Bifare191").Value, 0) .Controls("Etichetă196").Visible = Nz(.Controls("Bifare191").Value, 0) .Controls("Combo193").Visible = Nz(.Controls("Bifare191").Value, 0) .Controls("Text195").Visible = Nz(.Controls("Bifare191").Value, 0) End With End Sub Private Sub Form_Current() Dim strControlName As String strControlName = "~" On Error Resume Next strControlName = Me.ActiveControl.Name If InStr("/Combo193/Text195/", strControlName) > 0 Then Me.Controls("Bifare191").SetFocus End If Call Bifare191_AfterUpdate End Sub
What are the names of the controls?
You have:
checkbox
combobox
textbox