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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
| Private Sub chkfournisseur_Click()
Dim a As String
If chkfournisseur.Value = True Then
a = "fournisseur.codefournisseur"
End If
End Sub
Private Sub cmdannuler_Click()
DoCmd.Close
End Sub
Private Sub cmdrech_Click()
Dim db As Database
Dim rs As Recordset
Dim str As String
Dim sql As String
str = "C:\Documents and Settings\Propriétaire\Bureau\Stage\testBDD2.accdb"
Set db = OpenDatabase(str)
sql = "SELECT DISTINCT solution.description, emplacement,datecreation,datemodif," & a & "FROM modele, probleme, motscles, associer, avoir, contenir, solution, correspondre, Document, fournisseur, fournir WHERE modele.codemodele = avoir.codemodele And avoir.numpb = probleme.numpb And probleme.numpb = associer.numpb And associer.nummots = motscles.nummots And contenir.numpb = probleme.numpb And contenir.numsolution = solution.numsolution And correspondre.numsolution = solution.numsolution And correspondre.numdoc = Document.numdoc And fournisseur.codefournisseur = fournir.codefournisseur And modele.codemodele = fournir.codemodele And " & b & " And " & c & " And " & d & " And " & f
Set rs = db.OpenRecordset(sql)
Do While Not rs.EOF
* *lblresultat.Text = rs!emplacement
*rs.Next
Loop
rs.Close
End Sub
Private Sub Form_Load()
lblresultat.Visible = False
End Sub
Private Sub lstmarque_BeforeUpdate(Cancel As Integer)
Dim b As String
If Nz(lstmarque, "") <> "" Then
b = "and marque='lstmarque.Text'"
End If
End Sub
Private Sub lstmodele_BeforeUpdate(Cancel As Integer)
Dim c As String
If Nz(lstmodele, "") <> "" Then
c = "and modele.codemodele='lstmodele.Text'"
End If
End Sub
Private Sub lsttypepb_BeforeUpdate(Cancel As Integer)
Dim d As String
If Nz(lsttypepb, "") <> "" Then
d = "and probleme.typepb='lsttypepb.Text'"
End If
End Sub
Private Sub txtmot_BeforeUpdate(Cancel As Integer)
Dim e As String
Dim mots As String
Dim i As Integer
Dim f As String
e = ""
tabmots = Split(txtmot.Text, " ")
For i = 0 To UBound(mots)
e = e & "'" & tabmots(i) & "',"
Next i
f = "and nom in (e)"
End Sub |
Partager