Bonjour,
Je commence à faire mon formulaire de recherche à partir d'un des tutoriel:
http://cafeine.developpez.com/access...echerchemulti/
Mon début de code pourtant simple ne fonctionne pas:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Dim SQL As String SQL = "SELECT Articles.FERT, Articles.FlexivacNum, Articles.Structure, Customers.CustomerName, Customers.DeliveryCountry FROM TestStructures INNER JOIN (Structures INNER JOIN (ComponentsProperties RIGHT JOIN (Customers INNER JOIN (Articles LEFT JOIN FERT_Components ON Articles.FERT = FERT_Components.Fert) ON Customers.CustomerNum = Articles.CustomerNum) ON ComponentsProperties.ComponentName = FERT_Components.ComponentName) ON Structures.Structure = Articles.Structure) ON TestStructures.TestStructure = Structures.TestStructure WHERE ((Customers.CustomerNum<>0) " If optCustomer.Value = 3 Then SQL = SQL & "And ((Customers.DeliveryCountry) = '" & Me.cboCustomerCountry & "') " End If If optCustomer.Value = 1 And Me.cboCustomerNum.Value <> "" Then SQL = SQL & "And ((Customers.CustomerNum) = '" & Me.cboCustomerNum & "') " End If If optCustomer.Value = 2 And Me.txtCustomerName.Value <> "" Then SQL = SQL & "And ((Customers.CustomerName) like '*" & Me.txtCustomerName & "*') " End If If optStructure.Value = 1 Then SQL = SQL & "And ((Articles.FlexivacNum) = '" & Me.cboFlexivacNum & "') " End If If optStructure.Value = 2 Then SQL = SQL & "And ((Articles.Structure) = '" & Me.cboStructure & "') " End If If optStructure.Value = 3 Then SQL = SQL & "And ((Structures.TestStructure) = '" & Me.cboTestStructure & "') " End If SQL = SQL & ")GROUP BY Articles.FERT, Articles.FlexivacNum, Articles.Structure, Customers.CustomerName, Customers.DeliveryCountry;" Me.lstresults.RowSource = SQL Me.lstresults.Requery End Sub
Une idée?
Merci
Partager