Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Bay Area

    Unanswered: Comparing Strings Question

    I am curious to know if case is always disregarded in string comparison as I have used it in the code below. In testing this code, I found that "S" was matched with "s". Version is Access 2003.

    Function Test_VP()
        Call Voice_Change("<Sam>")
    End Function
    Function Voice_Change(inText As String) As Integer
    'voice to be changed if inText contains <michael> or <michelle> or <sam>
    Dim vFlagStart As Integer, vFlagEnd As Integer
    Dim voiceCode As Integer
    Dim targetVoice As String
        vFlagStart = InStr(inText, "<")
        vFlagEnd = InStr(inText, ">")
        If vFlagStart > 0 And vFlagEnd > vFlagStart Then
            targetVoice = Mid(inText, vFlagStart, (vFlagEnd - vFlagStart) + 1)
            Select Case targetVoice
                Case Is = "<michael>"
                    voiceCode = 1
                Case Is = "<michelle>"
                    voiceCode = 2
                Case Is = "<sam>"
                    voiceCode = 3
                Case Else
                    voiceCode = 0
            End Select
        End If
        Voice_Change = voiceCode
    End Function
    Last edited by JerryDal; 04-16-10 at 10:22. Reason: function return statement changed to "Voice_Change"

  2. #2
    Join Date
    Oct 2009
    depends on the code.

    do the compare on the binary and it will be case sensitive

    isn't really an Access question - is a vb question....

Posting Permissions

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