I have text and combo boxes on a subform which I would like when loaded to not appear on the form. They are automatically updated from other boxes on the main form. I tried setting their property to Visible=No and this did not work. Then I tried the following code in the main form load event procedure:
Private Sub Form_Load()
[Form_A Crew Subform].Shift_Date.Visible = False
[Form_A Crew Subform].Shift.Visible = False
[Form_A Crew Subform].Supervisor.Visible = False
[Form_A Crew Subform].Employee_Name.Visible = False
End Sub
Now when I open the main form I am getting:
Run-time error '2165':
You can't hide a control that has the focus.
Any help or suggestions appreciated,
Pam
Private Sub Form_Load()
[Form_A Crew Subform].Shift_Date.Visible = False
[Form_A Crew Subform].Shift.Visible = False
[Form_A Crew Subform].Supervisor.Visible = False
[Form_A Crew Subform].Employee_Name.Visible = False
End Sub
Now when I open the main form I am getting:
Run-time error '2165':
You can't hide a control that has the focus.
Any help or suggestions appreciated,
Pam