UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Search String, Any Version    
 
   
mrdrjay
post Sep 13 2017, 03:57 AM
Post#1



Posts: 69
Joined: 27-June 14



Hello,

Please assist if you can. The following information is what I am attempting to accomplish. I want to do a search for I, II, IV, etc in a name for example Joe, Flow IV and return the Roman numeral numbers only as I have a the names being converted to propercase. I can do the manipulation to have the Numbers show as CAPS in the name I am just having an issue with the following
CODE
Dim RN As String
'MsgBox Mid(Forms!Testfrm!INFO, InStr(Forms!Testfrm!INFO, "III"), Len(Forms!Testfrm!INFO))

Dim strRN(0 To 9) As String, lngPosition As Long
      
strRN(0) = "I"
strRN(1) = "II"
strRN(2) = "III"
strRN(3) = "IV"
strRN(4) = "V"
strRN(5) = "VI"
strRN(6) = "VII"
strRN(7) = "VIII"
strRN(8) = "IX"
strRN(9) = "X"
'RN = Mid(Forms!Testfrm!INFO, InStr(Forms!Testfrm!INFO,  strRN(lngPosition)), Len(Forms!Testfrm!INFO))
'RN = Mid(Forms!Testfrm!INFO, InStr(Forms!Testfrm!INFO, "III"), Len(Forms!Testfrm!INFO))
'MsgBox RN



For lngPosition = LBound(strRN) To UBound(strRN)

    If strRN(lngPosition) = Mid(Forms!Testfrm!INFO, InStr(Forms!Testfrm!INFO, strRN(lngPosition)), Len(Forms!Testfrm!INFO)) Then
    'MsgBox lngPosition
' RN = Mid(Forms!Testfrm!INFO, InStr(Forms!Testfrm!INFO, strRN(lngPosition)), Len(Forms!Testfrm!INFO))
    MsgBox strRN(lngPosition)
End If
'MsgBox RN
Next lngPosition
to capture and return accordingly. Thanks
Go to the top of the page
 
moke123
post Sep 13 2017, 04:27 AM
Post#2



Posts: 1,087
Joined: 26-December 12
From: Western Ma.,L.I.,N.Y.,Jupiter,Fl.



do all the names look like- Joe, Flow IV? Could you use instrrev() to find the space before the roman numeral?
something like
CODE
Mid(YourString, InStrRev(trim(YourString), " "))


Go to the top of the page
 
mrdrjay
post Sep 13 2017, 07:30 AM
Post#3



Posts: 69
Joined: 27-June 14



They are all different names with different suffixes for example Calloway, John III or Doe, Joe C V. I forgot about the InStrRev it worked flawlessly. Thanks for your assistance.
Go to the top of the page
 
moke123
post Sep 13 2017, 05:59 PM
Post#4



Posts: 1,087
Joined: 26-December 12
From: Western Ma.,L.I.,N.Y.,Jupiter,Fl.



happy to help. Was wondering though, Do all the names have a suffix?
Go to the top of the page
 
mrdrjay
post Sep 14 2017, 03:58 AM
Post#5



Posts: 69
Joined: 27-June 14



Not All of the names will have it will change depending on additional or subtractions of personnel.
Go to the top of the page
 
moke123
post Sep 14 2017, 05:47 AM
Post#6



Posts: 1,087
Joined: 26-December 12
From: Western Ma.,L.I.,N.Y.,Jupiter,Fl.



heres a procedure I use for names. It will convert a name to proper case and I believe it capitolizes roman numerals.

MXC - proper names

immediate window results:
CODE
?mxc("doe, john vi")
Doe, John VI


edit: deleted code and posted link
This post has been edited by moke123: Sep 14 2017, 05:52 AM
Go to the top of the page
 
mrdrjay
post Sep 15 2017, 02:46 AM
Post#7



Posts: 69
Joined: 27-June 14



Thanks for the code.
Go to the top of the page
 
mrdrjay
post Sep 15 2017, 09:36 PM
Post#8



Posts: 69
Joined: 27-June 14



Once again. Thanks. It works Great!
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    19th September 2017 - 05:29 PM