GavZ Mostly Beginners Luck! Local time Today, 19:06 Joined May 4, 2007 Messages 56 Aug 23, 2007 #1 Hi, Ist it possible to pick out characters from a string. For example if i have a string of 50 characters can i pick out the 2nd 4th 6th 8th and 10th character? Thanks in advance!
Hi, Ist it possible to pick out characters from a string. For example if i have a string of 50 characters can i pick out the 2nd 4th 6th 8th and 10th character? Thanks in advance!
Rabbie Super Moderator Local time Today, 19:06 Joined Jul 10, 2007 Messages 5,906 Aug 23, 2007 #2 The Mid function should do the job for you. See Access help for more info
W WayneRyan AWF VIP Local time Today, 19:06 Joined Nov 19, 2002 Messages 7,122 Aug 23, 2007 #3 Gav, Code: Public Function GetEvenChars(strInput As String) As String Dim strTemp As String Dim i As Integer strTemp = "" i = 2 While i <= Len(strInput) strTemp = strTemp & Mid(strInput, i, 1) i = i + 2 Wend GetEvenChars = strTemp End Function Wayne
Gav, Code: Public Function GetEvenChars(strInput As String) As String Dim strTemp As String Dim i As Integer strTemp = "" i = 2 While i <= Len(strInput) strTemp = strTemp & Mid(strInput, i, 1) i = i + 2 Wend GetEvenChars = strTemp End Function Wayne