Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    RandyH is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2020
    Posts
    25

    Undoing a String Module

    My business is Jewelry Manufacturing. I use 'styles' to auto bill. Those styles are provided to me by a 3 party vendor. I have no control over those.

    The billing possibilities are almost endless, ex. XP123AM is a pendant with an amethyst. My shop charges the same to set whatever stone in being used, so having 25 different styles for 1000,s of items was not the way to go.

    11 years ago a guy named Gary on this forum helped me with the following module which works great! It undone (there is a term for that) the string to get to the base style, 'XP1234'. As you can see from the module below see it handled a couple of other issues.

    Here's another example of what the module does:

    RM1930E-025-WIL returns RM1930E-025-WIL which works fine.

    Here's the issue"

    ET001-300-8Y4 returns ET0001 which doesn't work as there are 500+ styles with different billing amounts.

    The 4 at the end does seem to denote anything useful to me if that helps.

    Thanks in advance!

    Public Function fGetFirstChars_Nums_w(pString As Variant) As String
    Dim tmp As String
    Dim tmpStr As String
    Dim strRemStr As String
    Dim strNxtChar As String
    Dim strPrevChar As String
    Dim strW As String
    Dim bytChrLoc As Byte
    Dim bytWLoc As Byte
    Dim bytRemLen As Byte
    Dim bytStrLen As Byte


    Dim strHyphen As String
    Dim cntr
    Dim NoNumber As Boolean
    Dim NoW As Boolean


    'set the values of the flags
    NoNumber = False
    NoW = False
    If Len(Trim(pString & "")) > 0 Then
    'rule "B" - if the string contains a "/"
    bytChrLoc = InStr(1, pString, "/")
    If bytChrLoc > 0 Then
    'the following code will loop until the
    'previous character is numberic
    FindLastNum:
    'Character before the "/" must be a number
    strPrevChar = Mid(pString, bytChrLoc - 1, 1)
    If IsNumeric(strPrevChar) Then
    tmp = Left(pString, bytChrLoc - 1)
    'next check for any number following the "/"
    strRemStr = Right(pString, Len(pString) - bytChrLoc)
    bytRemLen = Len(strRemStr)
    For cntr = 1 To bytRemLen
    strNxtChar = Mid(strRemStr, cntr, 1)
    If IsNumeric(strNxtChar) Then
    strNxtChar = Mid(strRemStr, cntr, 1)
    tmp = tmp + "/" + strNxtChar
    GoTo ChkForLetterW
    End If
    Next cntr
    If cntr = bytRemLen + 1 Then
    NoNumber = True
    End If
    ChkForLetterW:
    'check to see if the letter "W" exists
    'in the remainin g string
    bytWLoc = InStr(1, strRemStr, "W")
    If bytWLoc > 0 Then
    'read the "W" string from the string (no matter
    ' if it is a capital "W" or not it will still be
    ' the same character
    strW = Mid(strRemStr, bytWLoc, 1)
    tmp = tmp + strW
    Else
    NoW = True
    End If
    'rule "B-2" - if there is no number following the "/" and
    ' there is no "W" following the "/"
    'use rule "A"
    If NoNumber = True And NoW = True Then
    GoTo RuleA
    End If
    'the rules for "B" have been applied and the string is ready
    GoTo ReturnString
    Else
    'try to find the last number in the string
    bytChrLoc = bytChrLoc - 1
    GoTo FindLastNum
    End If
    Else
    tmp = pString
    End If

    'rule "C" - if the string contains a "-"
    bytChrLoc = InStr(1, tmp, "-")
    If bytChrLoc > 0 Then
    strHyphen = Right(tmp, Len(tmp) - (bytChrLoc - 1))
    tmp = Left(tmp, bytChrLoc - 1)
    Else
    strHyphen = ""
    End If


    RuleA:
    'rule "A" - String must end with a number except when
    ' there is a "W" in the string
    'find the last numeric value in the string
    strPrevChar = Right(tmp, 1)
    If IsNumeric(strPrevChar) Then
    GoTo ReturnString
    Else
    bytRemLen = Len(tmp)
    For cntr = 1 To bytRemLen
    strPrevChar = Mid(tmp, Len(tmp) - cntr, 1)
    If IsNumeric(strPrevChar) Then
    tmpStr = Left(tmp, Len(tmp) - cntr)
    GoTo ChkForExistingW
    End If
    Next cntr
    End If
    ChkForExistingW:
    bytRemLen = Len(tmp) - Len(tmpStr)
    strRemStr = Right(tmp, bytRemLen)
    bytWLoc = InStr(1, strRemStr, "W")
    If bytWLoc > 0 Then
    'read the "W" string from the string (no matter
    ' if it is a capital "W" or not it will still be
    ' the same character
    strW = Mid(strRemStr, bytWLoc, 1)
    tmp = tmpStr + strW
    Else
    tmp = tmpStr
    End If
    If strHyphen > "" Then
    tmp = tmp + strHyphen
    End If
    End If


    ReturnString:
    fGetFirstChars_Nums_w = tmp

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You should go back to edit your post and use code tags and proper indentation (it's a common complaint here so don't feel bad about it). Select it and click# on the forum toolbar, or cut, click # and insert between the resulting code tags. At my age, I don't have the patience required to read something like that. Perhaps a young-un will if you'd rather wait and not fix it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    I'm far from a young-un like my friend Micron, but I'll apply the indents for you.
    I believe the word your looking for is "parse"

    While I can understand the mechanics of the code I'm not sure I understand the rules.

    One thing I did notice suprises me that it doesn't error
    Code:
    Dim NoW As Boolean
    NoW = False 
    NoW = True
    Now is a reserved word. the now function returns the current date and time. (?NoW)

    Code:
    Public Function fGetFirstChars_Nums_w(pString As Variant) As String    Dim tmp As String
        Dim tmpStr As String
        Dim strRemStr As String
        Dim strNxtChar As String
        Dim strPrevChar As String
        Dim strW As String
        Dim bytChrLoc As Byte
        Dim bytWLoc As Byte
        Dim bytRemLen As Byte
        Dim bytStrLen As Byte
        Dim strHyphen As String
        Dim cntr
        Dim NoNumber As Boolean
        Dim NoW As Boolean
    
    
    
    
        'set the values of the flags
        NoNumber = False
        NoW = False
        If Len(Trim(pString & "")) > 0 Then
            'rule "B" - if the string contains a "/"
            bytChrLoc = InStr(1, pString, "/")
            If bytChrLoc > 0 Then
                'the following code will loop until the
                'previous character is numberic
    FindLastNum:
                'Character before the "/" must be a number
                strPrevChar = Mid(pString, bytChrLoc - 1, 1)
                If IsNumeric(strPrevChar) Then
                    tmp = Left(pString, bytChrLoc - 1)
                    'next check for any number following the "/"
                    strRemStr = Right(pString, Len(pString) - bytChrLoc)
                    bytRemLen = Len(strRemStr)
                    For cntr = 1 To bytRemLen
                        strNxtChar = Mid(strRemStr, cntr, 1)
                        If IsNumeric(strNxtChar) Then
                            strNxtChar = Mid(strRemStr, cntr, 1)
                            tmp = tmp + "/" + strNxtChar
                            GoTo ChkForLetterW
                        End If
                    Next cntr
                    If cntr = bytRemLen + 1 Then
                        NoNumber = True
                    End If
    ChkForLetterW:
                    'check to see if the letter "W" exists
                    'in the remainin g string
                    bytWLoc = InStr(1, strRemStr, "W")
                    If bytWLoc > 0 Then
                        'read the "W" string from the string (no matter
                        ' if it is a capital "W" or not it will still be
                        ' the same character
                        strW = Mid(strRemStr, bytWLoc, 1)
                        tmp = tmp + strW
                    Else
                        NoW = True
                    End If
                    'rule "B-2" - if there is no number following the "/" and
                    ' there is no "W" following the "/"
                    'use rule "A"
                    If NoNumber = True And NoW = True Then
                        GoTo RuleA
                    End If
                    'the rules for "B" have been applied and the string is ready
                    GoTo ReturnString
                Else
                    'try to find the last number in the string
                    bytChrLoc = bytChrLoc - 1
                    GoTo FindLastNum
                End If
            Else
                tmp = pString
            End If
    
    
            'rule "C" - if the string contains a "-"
            bytChrLoc = InStr(1, tmp, "-")
            If bytChrLoc > 0 Then
                strHyphen = Right(tmp, Len(tmp) - (bytChrLoc - 1))
                tmp = Left(tmp, bytChrLoc - 1)
            Else
                strHyphen = ""
            End If
    
    
    
    
    RuleA:
            'rule "A" - String must end with a number except when
            ' there is a "W" in the string
            'find the last numeric value in the string
            strPrevChar = Right(tmp, 1)
            If IsNumeric(strPrevChar) Then
                GoTo ReturnString
            Else
                bytRemLen = Len(tmp)
                For cntr = 1 To bytRemLen
                    strPrevChar = Mid(tmp, Len(tmp) - cntr, 1)
                    If IsNumeric(strPrevChar) Then
                        tmpStr = Left(tmp, Len(tmp) - cntr)
                        GoTo ChkForExistingW
                    End If
                Next cntr
            End If
    ChkForExistingW:
            bytRemLen = Len(tmp) - Len(tmpStr)
            strRemStr = Right(tmp, bytRemLen)
            bytWLoc = InStr(1, strRemStr, "W")
            If bytWLoc > 0 Then
                'read the "W" string from the string (no matter
                ' if it is a capital "W" or not it will still be
                ' the same character
                strW = Mid(strRemStr, bytWLoc, 1)
                tmp = tmpStr + strW
            Else
                tmp = tmpStr
            End If
            If strHyphen > "" Then
                tmp = tmp + strHyphen
            End If
        End If
    
    
    
    
    ReturnString:
        fGetFirstChars_Nums_w = tmp
    End Function
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    hey mokey, stop fishing and start teaching!

    I'm sad because no one from AWF seems to miss me and I am a young-un like you say.
    OK that's two lies I've told today.

    Oh yeah, and there is no such line label as "ReturnString"
    Another reason why I agree with your wonderment. Must be some code missing because there's no End Function either.
    Last edited by Micron; 12-02-2020 at 10:49 PM. Reason: added info
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,860
    Quote Originally Posted by Micron View Post

    I'm sad because no one from AWF seems to miss me
    Not true, I wondered where you had got to?

    Thought you were just too busy making guitars to be in all forums.

    Need to scroll to the bottom of the code that Moke added tags to see both of those?

  6. #6
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Quote Originally Posted by Micron View Post
    I'm sad because no one from AWF seems to miss me and I am a young-un like you say.
    Well I miss you as well, so
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    RandyH,

    The function does not give the result you posted for RM1930E-025-WIL. It drops the E after the 1930?????

    ?fGetFirstChars_Nums_w ("RM1930E-025-WIL" )
    RM1930-025-WIL

    Do you have a list of rules other than comments within the vba code?
    Can you explain the rules with some examples from your various product codes?

    I suggest you show us more codes and the "proper/expected results".

    There may be simpler code options if the rules were known in context.

    For consideration(soapbox): When people create their own codification scheme, rather than using normalized tables (1 field, 1 fact), it often is difficult to make modifications without impact to existing code; and difficult for others to understand the code based on deciphering the logic of processing routines.


    micron -- I see you everywhere and appreciate your posts; and do agree with the young-un.

    There is a ReturnString label when I copied and tested the code(O365).


    Code:
    ......
    'Changes/:
    'NoW ==> bNOW   'as pointed out by moke123
    ...........................
          If strHyphen > "" Then
                tmp = tmp + strHyphen
            End If
        End If
    
    ReturnString:
        fGetFirstChars_Nums_w = tmp
    End Function

    I have extracted comments from the vba that deal with rules:

    'rule "B" - if the string contains a "/"
    'Character before the "/" must be a number
    'check to see if the letter "W" exists
    'in the remainin g string
    'read the "W" string from the string (no matter
    ' if it is a capital "W" or not it will still be
    ' the same character

    'rule "B-2" - if there is no number following the "/" and
    ' there is no "W" following the "/"
    'use rule "A"
    'the rules for "B" have been applied and the string is ready

    'rule "C" - if the string contains a "-"

    RuleA:
    'rule "A" - String must end with a number except when
    ' there is a "W" in the string
    'find the last numeric value in the string
    'read the "W" string from the string (no matter
    ' if it is a capital "W" or not it will still be
    ' the same character
    Last edited by orange; 12-03-2020 at 08:33 AM. Reason: spelling

  8. #8
    RandyH is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2020
    Posts
    25
    Orange, thanks for your reply. You're right about; ?fGetFirstChars_Nums_w ("RM1930E-025-WIL" )
    RM1930-025-WIL.
    This result is the correct.

    And you're correct about the "codification scheme". However those fields are populated when I download a table supplied by a third party vendor. And, I do understand your concern how changing the Module to handle the one [Styles] I need can cause problems for other [Styles].
    Quite frankly I'm surprised this Module works as well as it does. It has allowed me to create a [TblBilling].[Styles] without having to provide multiple variables to each [TblBilling].[Styles]

    This is to explain why I don't, can't have a [TableBilling].[Styles] for every item. Most items are like this.

    Example. XP1234AM is a pendant I get paid to mount an Amethyst in. The shop is paid the same if it is an Amethyst or a Ruby, or 20-30 other variety of stones. My [TblBilling] would have 2-3 million records instead of the 40,000 it has. The module return XP1234 which allows me to auto bill every job using that [Styles]

    Here's the only real issue I have.

    This item is unique. Meaning there are no variables. (The same applies to "RM1930E-25-WIL" which the module returns accurate results.) When the module reads ET001-300-8Y4 it returns ET0001. But, the -300-8Y is the relevant info I need. The 4 at the end does seem to denote anything useful to me if that helps.
    I don't know enough (obviously) to see what coding in the module causes that or what might need to be added or modified.
    Maybe a second module to handle this is needed to handle this issue?


    Someone else mentioned they were surprised by no 'Error Code'.
    I do have an occasional problem will items like these.
    STBK-50 because STBK doesn't end with a number.
    It doesn't matter to me if the module can't handle this item, but it would be nice for the module to complete it's function without me having to manually change to date.

    Thanks RandyH


  9. #9
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    OK. I've read your post and still have some questions.

    What is the significance to you (or to the third party supplier if that's important) of the "-" and/or the numbers etc.? Why do some have two "-"? an some have none?
    We're flying blind here ---but willing to help. Need some guidance to offer anything helpful.

    In simple, plain English please tell us as much as you can what each of these codes mean.

    XP1234

    RM1930E-25-WIL

    ET001-300-8Y4

    STBK-50

    Also
    the -300-8Y is the relevant info I need. Please explain how this is relevant to you.

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Sounds like OP is dealing with a one-off issue here. If that's the case, why not just test the input value and if it's found to be the one, skip all the other code and just deal with the one? If there's a few, or can end up being a few, make a table of the exceptions and let the code check those for the input value.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Micron,

    Good thoughts. But if the OP has knowledge of the codes an from them the styles he needs, let's hear about them. If he knows the rules intimately it's worth knowing and getting them recorded.
    In any event knowing a pattern or identifying the issue of base styles and testing it with some data makes sense.

  12. #12
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Quote Originally Posted by RandyH View Post
    When the module reads ET001-300-8Y4 it returns ET0001. But, the -300-8Y is the relevant info I need. The 4 at the end does seem to denote anything useful to me if that helps.
    With some minor changes, function seems to returns the correct values (I think), but, if you'll give us more info about the desired retured values, we can provide a better code because is hard to someone to follow this spaghetti code and, also, as seems, Gary prefer to going from Greece to Italy via Japan.

    The code of fGetFirstChars_Nums_w with my necessarymodifications:
    Code:
    Public Function fGetFirstChars_Nums_w(pString As Variant) As String
        'Modified by accesstos
        'https://www.accessforums.net/showthread.php?t=82369&p=466687#post466687
        Dim tmp As String
        Dim tmpStr As String
        Dim strRemStr As String
        Dim strNxtChar As String
        Dim strPrevChar As String
        Dim strW As String
        Dim bytChrLoc As Byte
        Dim bytWLoc As Byte
        Dim bytRemLen As Byte
        Dim bytStrLen As Byte
        Dim strHyphen As String
        Dim cntr As Integer
        Dim NoNumber As Boolean
        Dim bNoW As Boolean
    
        'set the values of the flags
        NoNumber = False
        bNoW = False
        If Len(Trim(pString & "")) > 0 Then
            'rule "B" - if the string contains a "/"
            bytChrLoc = InStr(1, pString, "/")
            If bytChrLoc > 0 Then
                'the following code will loop until the
                'previous character is numberic
    FindLastNum:
                'Character before the "/" must be a number
                strPrevChar = Mid(pString, bytChrLoc - 1, 1)
                If IsNumeric(strPrevChar) Then
                    tmp = Left(pString, bytChrLoc - 1)
                    'next check for any number following the "/"
                    strRemStr = right(pString, Len(pString) - bytChrLoc)
                    bytRemLen = Len(strRemStr)
                    For cntr = 1 To bytRemLen
                        strNxtChar = Mid(strRemStr, cntr, 1)
                        If IsNumeric(strNxtChar) Then
                            strNxtChar = Mid(strRemStr, cntr, 1)
                            tmp = tmp + "/" + strNxtChar
                            GoTo ChkForLetterW
                        End If
                    Next cntr
                    If cntr = bytRemLen + 1 Then
                        NoNumber = True
                    End If
    ChkForLetterW:
                    'check to see if the letter "W" exists
                    'in the remaining string
                    bytWLoc = InStr(1, strRemStr, "W")
                    If bytWLoc > 0 Then
                        'read the "W" string from the string (no matter
                        ' if it is a capital "W" or not it will still be
                        ' the same character
                        strW = Mid(strRemStr, bytWLoc, 1)
                        tmp = tmp + strW
                    Else
                        bNoW = True
                    End If
                    'rule "B-2" - if there is no number following the "/" and
                    ' there is no "W" following the "/"
                    'use rule "A"
                    If NoNumber = True And bNoW = True Then
                        GoTo RuleA
                    End If
                    'the rules for "B" have been applied and the string is ready
                    GoTo ReturnString
                Else
                    'try to find the last number in the string
                    bytChrLoc = bytChrLoc - 1
                    GoTo FindLastNum
                End If
            Else
                tmp = pString
            End If
            'rule "C" - if the string contains a "-"
            bytChrLoc = InStr(1, tmp, "-")
            If bytChrLoc > 0 Then
                strHyphen = right(tmp, Len(tmp) - (bytChrLoc - 1))
                tmp = Left(tmp, bytChrLoc - 1)
            Else
                strHyphen = ""
            End If
    RuleA:
            'rule "A" - String must end with a number except when
            ' there is a "W" in the string
            'find the last numeric value in the string
            strPrevChar = right(tmp, 1)
            If IsNumeric(strPrevChar) Then
                GoTo ReturnString
            Else
                bytRemLen = Len(tmp)
                'For cntr = 1 To bytRemLen
                For cntr = bytRemLen To 1 Step -1
                    'strPrevChar = Mid(tmp, Len(tmp) - cntr, 1)
                    strPrevChar = Mid(tmp, cntr, 1)
                    If IsNumeric(strPrevChar) Then
                        'tmpStr = Left(tmp, Len(tmp) - cntr)
                        tmpStr = Left(tmp, cntr)
                        GoTo ChkForExistingW
                    End If
                Next cntr
            End If
    ChkForExistingW:
            'bytRemLen = Len(tmp) - Len(tmpStr)
            strRemStr = Mid(tmp, Len(tmpStr) + 1)
            bytWLoc = InStr(1, strRemStr, "W", vbTextCompare)
            If bytWLoc > 0 Then
                'read the "W" string from the string (no matter
                ' if it is a capital "W" or not it will still be
                ' the same character
                strW = Mid(strRemStr, bytWLoc, 1)
                tmp = tmpStr & strW
            Else
                tmp = tmpStr
            End If
            If strHyphen > "" Then
                'tmp = tmp + strHyphen
            End If
        End If
    ReturnString:
        'fGetFirstChars_Nums_w = tmp
        fGetFirstChars_Nums_w = tmp & strHyphen
    End Function
    The results:
    With "RM1930E-025-WIL" returns "RM1930-025-WIL"
    With "RM1930E/025WIL" returns "RM1930/0W"
    With "XP1234AM" returns "XP1234"
    With "ET001-300-8Y4" returns "ET001-300-8Y4"
    With "STBK-50" returns "-50" without any error.

    Cheers,
    John

  13. #13
    RandyH is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2020
    Posts
    25
    I've been testing your module all day and it appears to fix every issue I had. I only wish I knew enough to understand what you did! Thank you so much!
    BTW, are you John Spencer?

  14. #14
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Quote Originally Posted by RandyH View Post
    I've been testing your module all day and it appears to fix every issue I had.
    I'm so glad that hear that!
    Happy to help!

    Quote Originally Posted by RandyH View Post
    I only wish I knew enough to understand what you did!
    I've leave as comments the [few] lines that I replaced with mine, which seems below in bold:
    Code:
    '[...]
    RuleA:
            'rule "A" - String must end with a number except when
            ' there is a "W" in the string
            'find the last numeric value in the string
            strPrevChar = right(tmp, 1)
            If IsNumeric(strPrevChar) Then
                GoTo ReturnString
            Else
                bytRemLen = Len(tmp)
                'For cntr = 1 To bytRemLen
                For cntr = bytRemLen To 1 Step -1
                    'strPrevChar = Mid(tmp, Len(tmp) - cntr, 1)
                    strPrevChar = Mid(tmp, cntr, 1)
                    If IsNumeric(strPrevChar) Then
                        'tmpStr = Left(tmp, Len(tmp) - cntr)
                        tmpStr = Left(tmp, cntr)
                        GoTo ChkForExistingW
                    End If
                Next cntr
            End If
    ChkForExistingW:
            'bytRemLen = Len(tmp) - Len(tmpStr)
            'strRemStr = Right(tmp, bytRemLen)
            strRemStr = Mid(tmp, Len(tmpStr) + 1)
            bytWLoc = InStr(1, strRemStr, "W", vbTextCompare)
            If bytWLoc > 0 Then
                'read the "W" string from the string (no matter
                ' if it is a capital "W" or not it will still be
                ' the same character
                strW = Mid(strRemStr, bytWLoc, 1)
                tmp = tmpStr & strW
            Else
                tmp = tmpStr
            End If
            If strHyphen > "" Then
                'tmp = tmp + strHyphen 
            End If
        End If
    ReturnString:
        'fGetFirstChars_Nums_w = tmp
        fGetFirstChars_Nums_w = tmp & strHyphen
    End Function
    Quote Originally Posted by RandyH View Post
    Thank you so much!
    You're so welcome!

    Quote Originally Posted by RandyH View Post
    BTW, are you John Spencer?
    Is John Spencer alive?


    John

  15. #15
    RandyH is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2020
    Posts
    25
    John Spencer helped people here years ago. He really helped me, like you did!

    Question: I remember somehow using the Immediate Window to test Styles using my Module, but can't figure it how again. How do you do that?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 07-20-2020, 01:04 PM
  2. Replies: 5
    Last Post: 06-15-2018, 03:14 PM
  3. Replacing String Within Form Module
    By kdbailey in forum Access
    Replies: 3
    Last Post: 07-13-2016, 08:14 AM
  4. class module vs regular module
    By Madmax in forum Modules
    Replies: 1
    Last Post: 05-01-2012, 03:44 PM
  5. Replies: 4
    Last Post: 05-16-2011, 04:58 PM

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