1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| Dim Tableau() As String
Dim i As Integer
DoCmd.SetWarnings (False)
If Texte0 Like "*2°*" Then
'l'abstract contient plusieurs sous-parties
Tableau = Split(Me.Texte0, Chr(13))
'boucle sur le tableau pour visualiser le résultat
For i = 0 To UBound(Tableau)
If Tableau(i) Like "*N°*" Then
Dim sql, sql2 As String
' sql = "update tcassation2 set [url] ='" & Me.txturl & "' where len([url])<1"
sql = "update tcassation2 set [abs0] ='" & Tableau(i) & "' where [id] = 'c" & Right(Left(Tableau(i), 6), 3) & "' "
DoCmd.RunSQL sql
MsgBox "le 1er que je trouve i c'est :" & i & " " & Tableau(i)
Else
If Not Tableau(i) Like "*N°*" Then
sql2 = "update tcassation2 set [abs" & i & "] ='" & Tableau(i) & "' where [id] = 'c" & Right(Left(Tableau(0), 6), 3) & "' "
DoCmd.RunSQL sql2
End If
End If
Next i
Else
'le résultat de la fonction Split est stocké dans un tableau
Tableau = Split(Me.Texte0, Chr(13))
'boucle sur le tableau pour visualiser le résultat
For i = 0 To UBound(Tableau)
If Tableau(i) Like "*N°*" Then
Dim sql3, sql4 As String
' sql = "update tcassation2 set [url] ='" & Me.txturl & "' where len([url])<1"
sql3 = "update tcassation2 set [abs0] ='" & Tableau(i) & "' where [id] = 'c" & Right(Left(Tableau(i), 6), 3) & "' "
DoCmd.RunSQL sql3
Else
If Not Tableau(i) Like "*N°*" Then
MsgBox i & " " & Tableau(i)
sql4 = "update tcassation2 set [abs1] ='" & Tableau(i) & "' where [id] = 'c" & Right(Left(Tableau(i - 1), 6), 3) & "' "
DoCmd.RunSQL sql4
End If
End If
Next i
End If |
Partager