Confusion: The token self is a 'community standard reserved word': It is legal to use as a token, but everybody who codes in Python uses it as the first argument to member functions; and in classes to refer to the class instance it self... and for no other purpose. So your code seems meaningless to those of us who have been programming in Python for more than a few weeks, because we see self and our habits tell us to look for the rest of the class definition.
Your query variable holds a string. In Python, strings have member functions, but no attribute named 'request'.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...