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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
| Option Explicit
Private Sub ComboBox1_Change()
listviewrefresh Me.ListView1, Feuil5, ComboBox1.Value
Set ListView1.SelectedItem = Nothing
End Sub
Private Sub UserForm_Initialize()
ComboAdd ComboBox1, Feuil11
ThisWorkbook.Connections("Requête*-*OF_en_cours").Refresh
If listviewrefresh(Me.ListView1, Feuil5, ComboBox1.Value) = False Then
Label1.Visible = True
Else
Label1.Visible = False
End If
Set ListView1.SelectedItem = Nothing
End Sub
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
ListView1.Sorted = False
ListView1.SortKey = ColumnHeader.Index - 1
If ListView1.SortOrder = lvwAscending Then
ListView1.SortOrder = lvwDescending
Else
ListView1.SortOrder = lvwAscending
End If
ListView1.Sorted = True
End Sub
Private Sub CommandButton1_Click()
Dim i As Integer
Dim k As Integer
Dim item As ListItems
For i = 1 To ListView1.ListItems.count
If ListView1.ListItems(i).Selected Then
ModifOF "N°OF_BDD", ListView1.ListItems(i).Text, "Ordonancement", "Cloture", True
k = k + 1
End If
Next i
Select Case k
Case 0
MsgBox "Vous n'avez sélectionné aucun OF", vbInformation, "Selection"
Case 1
MsgBox k & " OF a été clôturé, vous pouvez le consulter dans la section <OF cloturés>", vbInformation, "Enregistré"
Case Else
MsgBox k & " OF ont été clôturés, vous pouvez les consulter dans la section <OF cloturés>", vbInformation, "Enregistré"
End Select
DoEvents
ThisWorkbook.Connections("Requête*-*OF_en_cours").Refresh
If listviewrefresh(Me.ListView1, Feuil5, ComboBox1.Value) = False Then
Label1.Visible = True
Else
Label1.Visible = False
End If
End Sub
Private Sub Listbox1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
ListBox1.Sorted = False
ListBox1.SortKey = ColumnHeader.Index - 1
ListBox1.SortOrder = IIf(ListView1.SortOrder = 0, 1, 0)
ListBox1.Sorted = True
End Sub
Private Sub CommandButton3_Click()
Dim wop As String
Dim k As Integer
Dim i As Integer
k = 0
For i = 1 To Me.ListView1.ListItems.count
If Me.ListView1.ListItems(i).Selected Then
k = k + 1
End If
Next i
If k > 1 Then
If MsgBox("Vous allez annoter tous les WOP sélectionnés avec la même annotation, voulez vous continuer ?", vbYesNo, "Multiselect") = vbNo Then GoTo fin
End If
Annotation.Show
For i = 1 To Me.ListView1.ListItems.count
If Me.ListView1.ListItems(i).Selected Then ModifOF "N°OF_BDD", Me.ListView1.ListItems(i), "Ordonancement", "Notes", Annot
Next i
If k > 1 Then
MsgBox "Les OF ont bien été annotés avec la mention <" & Annot & ">"
Else
MsgBox "L'OF a bien été annoté avec la mention <" & Annot & ">"
End If
DoEvents
ThisWorkbook.Connections("Requête*-*OF_en_cours").Refresh
listviewrefresh Me.ListView1, Feuil5, ComboBox1.Value
GoTo fin
fin:
End Sub |
Partager