Full Version: Subform field Question
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
avagodro
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
Else
Me.Text1.Visible = False
Me.cbo1.Visible = True
End If

My problem is with the txtFields1 textbox, or even being able to have the code check the [txtFields] control from frmMain

Any suggestions?
avagodro
Never mind. I was able to resolve the issue. It was a matter of the name of the subform
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.