The following VBA code evaluates to True if MyControl is a text box but False if MyControl is a subform control:
What is the correct syntax for comparing subform controls?Code:MyForm!MyControl Is MyForm.Controls("MyControl")
Edit: I've just discovered that MyForm!MyControl Is MyForm!MyControl and MyForm.Controls("MyControl") Is MyForm.Controls("MyControl") also evaluate to False if MyControl is a subform control!