hi,
can't get this to work properly
can't get this to work properly
Code:
Private Sub Numéro_du_projet_Click()
If Len(Me.Numéro_du_projet & "") < 1 Then
ElseIf Me.Localité.Column(2) = "" Or Me.Type.Column(2) = "" Then
MsgBox "Veuillez renseigner la localité et le type de projet."
Else
tSeq = Nz(DMax("Séquence", "Projets", "Localité=" & Me.Localité & " and " & "Type=" & Me.Type))
hiCount = Nz(DLookup("Compteur", "Projets", "Séquence=" & tSeq), 0) + 1
Me.Numéro_du_projet = Me.Localité.Column(2) & "-" & Me.Type.Column(2) & "-" & Format(Compteur, "000")
End If
End Sub
Last edited by a moderator: