Results 1 to 8 of 8
  1. #1
    rmd62163 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    17

    Lowercase and ignore

    Would it be possible to have the text entered in a text box on after update event force lowercase like
    Code:
     Me.History= StrConv(Me.History, 2) and some code to ignore the string between a set  of characters
    . And then somehow ignore anything in like brackets or parenthesis or anything that would keep it uppercase? this was something my son came up with in C# that I tried to convert to VB with no success.
    Code:
         Private Sub btnParse_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim parsedString As String
            Dim pFlag As Boolean
            Dim charIndex As char
            For Each charIndex In History.Value
                If (i = Microsoft.VisualBasic.ChrW(40)) Then
                    pFlag = True
                End If
                If (i = Microsoft.VisualBasic.ChrW(41)) Then
                    pFlag = False
                End If
                If Not pFlag Then
                    parsedString = (parsedString + char.ToLower(i))
                Else
                    parsedString = (parsedString + i)
                End If
            Next
            History.Value = parsedString
    
    
    
    
    End Sub
    I would appreciate any input into whether it would be possible or just not gonna happen?

  2. #2
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176
    Would an input mask work for what you want? http://office.microsoft.com/en-us/ac...010096452.aspx

  3. #3
    rmd62163 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    17

    Unhappy Will not

    Quote Originally Posted by offie View Post
    Would an input mask work for what you want? http://office.microsoft.com/en-us/ac...010096452.aspx
    Thanks for the thought, but it would not do what I need. The input is to random. histories of different occurrences. No pattern. The upper case characters may occur any where in the string as abbreviations for medical terms.

  4. #4
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176
    "< Converts all characters that follow into lowercase" then ?, sorry if that's not what you need

  5. #5
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    rmd62163 -

    If the input mask doesn't fit your situation, you could try something like...

    dim mystring, st1, st3, st4 as String
    st1 = Me![History]
    dim x, y, mypos, mypos1 as Integer
    x = Len(st1)
    mypos = InStr(1, st1, "(")
    mypos1 = InStr(1, st1, ")")

    If mypos = 0 And mypos1 = 0 then
    mystring = StrConv(st1, vbLowerCase)
    Me![History] = mystring
    else

    For y = 1 to x
    st3 = Mid(st1, y, 1)

    If y < mypos then
    st4 = StrConv(st3, vbLowerCase)
    mystring = mystring + st4
    End If

    If y >= mypos And y <= mypos1 then
    st4 = st3
    mystring = mystring + st4
    End If

    If y > mypos1 then
    st4 = StrConv(st3, vbLowerCase)
    mystring = mystring + st4
    end if

    Next y

    End If

    Me![History] = mystring

    I tested the above code very quickly using a button click event; you should be able to adapt it to an after update event.

    Hope this helps,

    Jim

  6. #6
    rmd62163 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    17

    Solved

    Jim,
    Thank you very much. It works perfectly. Now I will take the next few days to break that down to my level of competency. But I can honestly say I would of not solved it that quickly. Again thank you and Thank you Offie for your advice I have a better understanding of the input mask that I will put to use after reading the link to it. MUCH APPRECIATED MY FRIENDS!

  7. #7
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    rmd62163 -

    Your welcome. I didn't have time to add in any error handling, so you may want to do that.

    Good luck with your project!

    Jim

  8. #8
    rmd62163 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    17
    Jim,

    Will do, Again thank you for the resolution.

    Bob

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to Ignore Err 2501
    By Jojojo in forum Reports
    Replies: 3
    Last Post: 11-11-2011, 06:30 PM
  2. ignore delete error
    By smahdih in forum Access
    Replies: 1
    Last Post: 11-05-2011, 03:42 PM
  3. Replies: 1
    Last Post: 03-01-2011, 03:01 PM
  4. Changing table names from lowercase to uppercase
    By supernix in forum Database Design
    Replies: 1
    Last Post: 09-03-2010, 10:08 PM
  5. Uppercase to Lowercase
    By tigers in forum Reports
    Replies: 1
    Last Post: 09-28-2009, 10:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums