Salut Loufab,
Merci pour ton dévouement, le mot n'est pas trop fort.
J'ai finalement trouvé le code à faire grâce aussi à Lilo51 du club.
Voici le code:
Dim rst As Recordset, maBD As Database, leNbre As Long, stLinkCriteria
Set maBD = CurrentDb
Set rst = maBD.OpenRecordset("facturation", dbOpenDynaset)
With rst
.MoveLast
leNbre = !Numfact
.AddNew
!Numfact = leNbre + 1
leNbre = rst!Numfact
![Date facture] = Date
.Update
.Close
End With
stLinkCriteria = "NumFact =" & leNbre
DoCmd.OpenForm "FacturesExMeCa", acNormal, , stLinkCriteria, acFormEdit
Forms!FacturesExMeCa!Numfact = leNbre
Forms!FacturesExMeCa!NCL = Forms!Clients!NCL
Forms!FacturesExMeCa!TF = "FME"
Forms!FacturesExMeCa!NfactLettre = "FME" & leNbre
End Function
@+