SSRS Custom Code to Get Textbox Name

Here’s a simple SSRS function that will get you the textbox name.

Public Function TextBoxName(ByVal meString As String) As String
Dim s As Integer = 19
Dim e As Integer = meString.IndexOf(“_TextBoxExprHost”) – 19
TextBoxName = meString.Substring(s,e)
End Function


‘Me’ is the object you are ‘in’… and Me.ToString returns the following:


Our custom code extracts the Textbox Name from the Me string.


Report > Report Properties > Code


Add the expression where you need it… i.e. maybe you need to dynamically change the¬†background¬†color of all textboxes in a table, or set the hidden property.


Here’s the output:


Leave a Reply

Your email address will not be published. Required fields are marked *