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
| Public Sub RefreshQuery()
Dim SQL As String
'recherche qui sera affiché comme equipmentType pour les Umbi ou les Flying Leads
SQL = "SELECT DISTINCT [EquipmentTypes].[EquipmentType], [EquipmentTypes].[IDType] FROM EquipmentTypes "
If Me.chk_hyd Then
SQL = SQL & "WHERE [EquipmentTypes]![EquipmentType] = HYD"
End If
If Me.chk_el Then
If Me.chk_hyd Then
SQL = SQL & "-EL"
Else
SQL = SQL & "WHERE [EquipmentTypes]![EquipmentType] = EL"
End If
End If
If Me.chk_inh Then
If Me.chk_hyd Or Me.chk_el Then
SQL = SQL & "-INH"
Else
SQL = SQL & "WHERE [EquipmentTypes]![EquipmentType] = INH"
End If
End If
If Me.chk_ch Then
If Me.chk_hyd Or Me.chk_el Or Me.chk_inh Then
SQL = SQL & "-CH"
Else
SQL = SQL & "WHERE [EquipmentTypes]![EquipmentType] = HYD"
End If
End If
If Me.chk_gl Then
If Me.chk_hyd Or Me.chk_el Or Me.chk_inh Or Me.chk_ch Then
SQL = SQL & "-GL"
Else
SQL = SQL & "WHERE [EquipmentTypes]![EquipmentType] = GL"
End If
End If
If Me.chk_sp Then
If Me.chk_hyd Or Me.chk_el Or Me.chk_inh Or Me.chk_ch Or Me.chk_gl Then
SQL = SQL & "-SP"
Else
SQL = SQL & "WHERE [EquipmentTypes]![EquipmentType] = SP"
End If
End If
Me.zt_IDType.RowSource = SQL
Me.zt_IDType.Requery
End Sub |
Partager