Private Sub B_validation_Click()
If Me.nom = "" Then
MsgBox "Saisir un nom"
Me.nom.SetFocus
Exit Sub
End If
If Not IsDate(Me.Date) Then
MsgBox "Saisir une date "
Me.Date.SetFocus
Exit Sub
End If
'--- Transfert Formulaire dans BD
'-- Gr
temp = ""
For Each c In Me.Gr.Controls
If c.Value = True Then
temp = c.Caption
End If
Next c
f.Cells(ligneEnreg, 1) = temp
'-- Magasin
temp = ""
For Each c In Me.Mag.Controls
If c.Value = True Then
temp = c.Caption
End If
Next c
f.Cells(ligneEnreg, 8) = temp
With f
On Error Resume Next
f.[A1].Sort key1:=[D2], Order1:=xlAscending, Header:=xlGuess
End With
f.Cells(ligneEnreg, 2) = UCase(Me!nom)
f.Cells(ligneEnreg, 3) = Application.Proper(Me.Prenom)
f.Cells(ligneEnreg, 4) = UCase(Me!nom) & "_" & Application.Proper(Me.Prenom)
f.Cells(ligneEnreg, 5) = Me.Service
f.Cells(ligneEnreg, 6) = CDate(Me.Date)
f.Cells(ligneEnreg, 7) = Me.Tel
Columns("F:F").NumberFormat = "m/d/yyyy" 'format date courte
End Sub