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
| Private Sub CtrlListeClient_AfterUpdate()
Dim rep As integer
,,,,,,,,
rep = ChercherLeNumFactureIncrementer
Me.[#FACTURE] = rep
End Sub
Public Function ChercherLeNumFactureIncrementer() As Integer
Dim dbsDardo As DAO.Database
Dim rstFacture As DAO.Recordset
Dim rep As Integer
Set dbsDardo = CurrentDb
Set rstFacture = dbsDardo.OpenRecordset("TFACTURE", dbOpenDynaset)
If (rstFacture.EOF = True And rstFacture.BOF = True) Then
rstFacture.AddNew
rep = rstFacture![#FACTURE]
ChercherLeNumFactureIncrementer = rep + 1
Else
rstFacture.MoveLast
rep = rstFacture![#FACTURE]
ChercherLeNumFactureIncrementer = rep + 1
End If
rstFacture.Close
dbsDardo.Close
Set rstFacture = Nothing
Set dbsDardo = Nothing
End Function |
Partager