I have a form with a subform linked. In the form, there is a field "txtFields" that I want to have as a condition in my subform.
Basically, [txtFields] will either be Text or Combo. If it is Text, then a Textbox will be visible in the subform. If Combo, then a Combobox will be visible.
I have tried creating a hidden field on my subform with a default value of =[frmMain]![txtFields] but I keep ending up with a Name? error. I had named the textbox on my subform as txtFields1
The code that I have written that will display the appropriate type of control is:
if Me.txtFields1 = "Text" Then
Me.Text1.Visible = True
Me.cbo1.Visible = False
Me.Text1.Visible = False
Me.cbo1.Visible = True
My problem is with the txtFields1 textbox, or even being able to have the code check the [txtFields] control from frmMain