2 Replies - 2074 Views - Last Post: 23 February 2011 - 06:25 PM

#1 theunborncoder   User is offline

  • D.I.C Head
  • member icon

Reputation: 13
  • View blog
  • Posts: 123
  • Joined: 15-October 09

trim all text box on form

Posted 03 December 2009 - 10:56 PM

Description: we can use this function for validation
Public Sub prcTrimAll(frm As Form)
Dim control As control
    For Each control In frm
        If TypeOf control Is TextBox Then
            control = Trim(control)
        End If
    Next
End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: trim all text box on form

#2 motcom   User is offline

  • D.I.C Lover
  • member icon

Reputation: 293
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: trim all text box on form

Posted 08 December 2009 - 06:35 AM

This will only work for controls on a From. If there are controls like Panels or Tab Controls, then this needs to be nested again.
Was This Post Helpful? 0
  • +
  • -

#3 HRT   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 23-February 11

Re: trim all text box on form

Posted 23 February 2011 - 06:25 PM

How do you trim a rich text box? I need to remove several vbcrlf from the end of text inside a rich text box. I tried your snipet but it did not work. Any idea? Thanks very much for any help in advance.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1