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
| Private ()
Dim db As DAO.Database
Dim rq_ent As DAO.Recordset
Dim rq_ent2 As DAO.Recordset
Set db = OpenDatabase("D:\Data\base.mdb")
' L'ERREUR PROVIENT A MON AVIS DE LA LIGNE SUIVANTE
Set req_ent = db.OpenRecordset("SELECT [contact.Nom], [contact.NUMSOC], [societe.Societe], [societe.CP], [societe.NUMSOC] FROM [societe] INNER JOIN [contact] ON (societe.NUMSOC] = [contact.NUMSOC]) WHERE (([societe.Societe]='" & Me.ComboBox1.Value & "') AND ([societe.CP]='" & Me.ComboBox2.Value & "'));")
Set req_ent2 = db.OpenRecordset("SELECT [societe.Societe], [societe.CP], [societe.AdresseLigne1], [societe.AdresseLigne2], [societe.Localite] FROM [societe] WHERE (([societe.Societe]='" & Me.ComboBox1.Value & "') AND ([societe.CP]='" & Me.ComboBox2.Value & "'));")
If req_ent.RecordCount > 0 Then
req_ent.MoveFirst
Do While req_ent.EOF = False
ComboBoxAttn.AddItem req_ent![contact.Nom]
req_ent.MoveNext
Loop
Else
ComboBoxAttn.Text = ""
End If
TextBoxAdrligne1 = req_ent2![societe.AdresseLigne1]
TextBoxAdrligne3 = req_ent2![societe.CP] & " " & req_ent2![societe.Localite]
Exit Sub
End Sub |
Partager