Clé automatique personnalise en ACCESS
Résolu lafiabougou1 Messages postés 43 Date d'inscription Statut Membre Dernière intervention -
lafiabougou1 Messages postés 43 Date d'inscription Statut Membre Dernière intervention - 12 janv. 2025 à 14:17
lafiabougou1 Messages postés 43 Date d'inscription Statut Membre Dernière intervention - 12 janv. 2025 à 14:17
A voir également:
- Clé automatique personnalise en ACCESS
- Clé usb non détectée - Guide
- Clé windows 10 gratuit - Guide
- Réponse automatique thunderbird - Guide
- Formater clé usb - Guide
- Logiciel de sauvegarde automatique gratuit - Guide
4 réponses
bonjour, cela se fait en général via une fonction VBA.
un exemple:
Option Explicit Function specialkey() As String Dim debut As String, existant debut = "SC" + Right(CStr(Year(Now())), 2) existant = Right(DMax("custom", "customkey", "len(custom)=8 and custom like '" + debut + "*'"), 4) If Not IsNumeric(existant) Then existant = "0000" End If specialkey = debut + Format(CInt(existant) + 1, "0000") Debug.Print Now(), debut, existant, specialkey End Function
Ensuite, créer une macro "avant modification", qui modifie le champ.