Public Function Comp(sql As String) As String Dim db As Database, rs As Recordset, i As Long, Res As String, Tmp As String Dim Stelle As Variant, drin As Variant Dim Part_SQL1 As String, SQL1 As String, SQL2 As String On Error Resume Next Set db = CurrentDb() Set rs = db.OpenRecordset(sql, dbOpenSnapshot) If Err <> 0 Then Res = "#Fehler" Else On Error GoTo 0 Res = "" Do While Not rs.EOF SQL1 = rs(0) SQL2 = rs(1) 'If SQL1 Or SQL2 = "" Then ' GoTo Weiter 'End If Do Stelle = InStr(1, SQL1, ",") If Stelle = 0 Then If Left(SQL1, 1) = " " Then Part_SQL1 = Mid(SQL1, 2) Else Part_SQL1 = SQL1 End If Else Part_SQL1 = Left(SQL1, Stelle - 1) End If drin = InStr(1, SQL2, Part_SQL1) If Left(Part_SQL1, 1) = " " Then Part_SQL1 = Mid(Part_SQL1, 2) End If If drin <> 0 Then Res = Res & ", " & Part_SQL1 End If SQL1 = Mid(SQL1, Stelle + 1) Loop Until Stelle = 0 Res = Mid(Res, 3) rs.MoveNext Loop rs.Close End If WEITER: Comp = Res End Function
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: