Try something like this.
this returns true if obj is a text box and false if it isn'tCode:Private Function IsTextBox(obj As Object) As Boolean Dim objTemp As TextBox On Error GoTo Err_NotTextbox: Set objTemp = obj IsTextBox = True Exit Function Err_NotTextbox: IsTextBox = False End Function
Hope this helps




Reply With Quote