Private Sub CommandButton6_Click() 'bouton recherche
Dim Ctrl As Control, Coln As Integer
With Sheets("BD_RECLAMATION")
ColPub = 0
DataPub = ""
If Me.ComboBox06.ListIndex > -1 Then
DataPub = Me.ComboBox06
ColPub = 6
End If
If Me.ComboBox07.ListIndex > -1 Then
DataPub = Me.ComboBox07
ColPub = 7
End If
If Me.ComboBox15.ListIndex > -1 Then
DataPub = Me.ComboBox15
ColPub = 15
End If
formulaire_rech.Show
If LigS = 0 Then Exit Sub
For Each Ctrl In Me.Controls
Select Case TypeName(Ctrl)
Case "TextBox"
Coln = Val(Replace(Ctrl.Name, TypeName(Ctrl), ""))
Me.Controls(Ctrl.Name).Value = .Cells(LigS, Coln)
Case "ComboBox"
Coln = Val(Replace(Ctrl.Name, TypeName(Ctrl), ""))
Me.Controls(Ctrl.Name).Value = .Cells(LigS, Coln)
Case "DTPicker"
Coln = Val(Replace(Ctrl.Name, TypeName(Ctrl), ""))
Me.Controls(Ctrl.Name).Value = .Cells(LigS, Coln)
End Select
Next Ctrl
End With
End Sub
'---------------------------------------------------
' Utilisation :enregistrer les modifications
'--------------------------------------------------
Private Sub CommandButton7_Click() 'bouton enregistrer
Dim Ctrl As Control, Coln As Integer
With Sheets("BD_RECLAMATION")
If LigS = 0 Then Exit Sub
For Each Ctrl In Me.Controls
Select Case TypeName(Ctrl)
Case "TextBox"
Coln = Val(Replace(Ctrl.Name, TypeName(Ctrl), ""))
.Cells(LigS, Coln) = Me.Controls(Ctrl.Name).Value
Case "ComboBox"
Coln = Val(Replace(Ctrl.Name, TypeName(Ctrl), ""))
.Cells(LigS, Coln) = Me.Controls(Ctrl.Name).Value
Case "DTPicker"
Coln = Val(Replace(Ctrl.Name, TypeName(Ctrl), ""))
.Cells(LigS, Coln) = Me.Controls(Ctrl.Name).Value
End Select
Next Ctrl
End With
Unload formulaire_pF
formulaire_pF.Hide
End Sub