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
| Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
Dim myrecordset As New ADODB.Recordset
myrecordset.ActiveConnection = cnn1
Dim cnn2 As ADODB.Connection
Set cnn2 = CurrentProject.Connection
Dim myrecordset2 As New ADODB.Recordset
myrecordset2.ActiveConnection = cnn2
myrecordset.Open "SELECT * FROM [RAPPORT DE VOYAGE] LEFT JOIN Clients ON [RAPPORT DE VOYAGE].Code = Clients.Code WHERE ((([RAPPORT DE VOYAGE].Code) Like '" & Forms![PROFIL LBA menu]!Modifiable0.Value & "')) ORDER BY [RAPPORT DE VOYAGE].Date; "
DoCmd.SetWarnings False
With myrecordset
Do Until .EOF
If IsNull(myrecordset.Fields("N°")) Then
MsgBox ("tutu")
myrecordset2.Open "SELECT * FROM clients where code='" & Forms![PROFIL LBA menu]!Modifiable0.Value & "'"
With myrecordset2
Do Until .EOF
Me.[Numéro de code UBS].Value = myrecordset2.Fields("Numéro de code UBS")
Me.[Date d'ouverture].Value = myrecordset2.Fields("Date d'ouverture")
Me.[Numero de code LEU].Value = myrecordset2.Fields("Numero de code LEU")
Me.[Numéro de code bve].Value = myrecordset2.Fields("Numéro de code bve")
Me.Code.Value = myrecordset2.Fields("Code")
Reports![PROFIL LBA]![Référence2].Value = myrecordset2.Fields("Référence")
Me.[Agence].Value = myrecordset2.Fields("Agence")
Me.[Référé par].Value = myrecordset2.Fields("Référé par")
Me.[Objectifs].Value = myrecordset2.Fields("Objectifs")
Me.[Stamm BVE].Value = myrecordset2.Fields("Stamm BVE")
Me.[Stamm LEU].Value = myrecordset2.Fields("Stamm LEU")
Me.[Stamm UBS].Value = myrecordset2.Fields("Stamm UBS")
Me.[Situation professionnelle].Value = myrecordset2.Fields("Situation professionnelle")
Me.[Potenteil du compte].Value = myrecordset2.Fields("Potentiel du compte")
Me.[Origine des fonds].Value = myrecordset2.Fields("Origine des fonds")
Me.[Provenance des fonds].Value = myrecordset2.Fields("Provenance des fonds")
Me.[Etablissement de la relation d affaires].Value = myrecordset2.Fields("Etablissement de la relation d affaires")
Me.[politique d'investissement].Value = myrecordset2.Fields("Politique d'investissement")
Me.[Remarque].Value = myrecordset2.Fields("Remarque")
Me.[Rapport visite, tél, divers].Value = myrecordset2.Fields("Rapport visite, tél, divers")
Me.[TEXTE].Value = "AUCUNE DONNÉE DISPONIBLE"
myrecordset2.MoveNext
Loop
End With
End If
myrecordset.MoveNext
Loop
End With
DoCmd.SetWarnings True |