Hi Bill
Yes you can make a subform visible/not visible depending on a value selected in a combo box.
You would need to add the coding to the AfterUpdate event of the combo box. How you decide to code the response to the values selected, which will in turn change the subform visibility,depends on how many values are involved.
That sounds a bit obscure, but if you have a small number of values in your combo box then you may prefer to use
If/Then/Else/End If
With more values you may want to use Select Case.
For example
Sub cboMyCombo_AfterUpdate
On Error GoTo Err_cboMyCombo_AfterUpdate
Select Case Me!cboMyCombo
Case 1
Me!frmMySubform.Form.Visible = False
Case 2 To 8
Me!frmMySubform.Form.Visible = True
Case 9
Me!frmMySubform.Form.Visible = False
End Select
Exit_cmdMyCombo_AfterUpdate:
Exit
Err_cmdMyCombo_AfterUpdate:
MsgBox Error$
Resume Exit_cmdMyCombo_AfterUpdate
End Sub
This would work if your values were numerical - 1 to 9. If your values were words then you would put:
Case "Subform Visible"
Case "No Subform Visible"
Or if the subform was to be displayed for employees then you would have:
Case "employee"
Me!frmMySubform.Form.Visible = True
Case "client"
Me!frmMySubform.Form.Visible = False
Try it out! I hope it works for you!
Rich