Consulting

Results 1 to 4 of 4

Thread: Help VBA search

  1. #1

    Help VBA search

    Please help me to see if there are any errors in the form2 when I used the SEARCH button.
    Attached Files Attached Files

  2. #2
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    I'm scared to open it for a few of reasons...

    1. It's your first post
    2. The question is ambiguous and
    3. The flags are Vietnam and Alaska - if those two flags together mean something then I apologise for my ignorance, I'm Welsh!
    Semper in excretia sumus; solum profundum variat.

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Chào

    The first thing I looked at was VBAProper. I rewrote it to be a little shorter and possibly faster
    Option Explicit
    
    Function VBAProper(ByVal MyText As String) As String
    Dim i As Long
    Dim Arr As Variant
    
    If Trim(MyText) = "" Then Exit Function
    
    MyText = LCase(MyText)
    Arr = Split(MyText)
        For i = LBound(Arr) To UBound(Arr)
            MyText = MyText & UCase(Left(Arr(i), 1)) & Mid(Arr(i), 2, Len(Arr(i)))
            Do While i <> UBound(Arr): MyText = MyText & " ": Loop
        Next i
    VBAProper = MyText
    End Function
    You have VBAProper in two modules: Delete one copy

    Then I noticed that all your UserForm Controls had Control.Type prefixes (txDAYKD or txtTENKH,) but, in your code, they were all without prefixes, (DAYKD or TENKH.)

    With a little creative thinking, you can select all Control subs, then use CTRL+H to replace all "Sub " with "Sub txt", and rename control txDAYKD to txtDAYKD

    If you place "Option Explicit" at the top of every code page, then use VBA Menu Debug >> Compile, you will find most errors in your code.


    Chúc may mắn
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  4. #4
    VBAX Expert Leith Ross's Avatar
    Joined
    Oct 2012
    Location
    San Francisco, California
    Posts
    552
    Location
    @ paulked,

    I was wondering about that same thing. What is even stranger is the times are the same. How is that possible?
    Sincerely,
    Leith Ross

    "1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •