Bonjour tout le monde
Svp .. si vous pouvez m'aider a resoudre ce probleme
J'aimeria bien obtenir une numerotation de cette facon comme exemple : 04032020-0001
J'ai suivi ce sujet :
https://www.developpez.net/forums/d1...ique-database/
J'ai mis le champs INVOICES_Id de type numerique
Mais malheureusement rien se s'affiche dans TextBox1 .. aussi aucun message d'erreur ne s'affiche
Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim Req_Id As String
        Req_Id = Format(Today, "ddMMyyyy")
        Conne.Open()
        Dim Dt As New DataTable
        Dim Da As New OleDbDataAdapter("SELECT * From TBL_INVOICES", Conne)
        Da.FillSchema(Dt, SchemaType.Source)
        Da.Fill(Dt)
        If Dt.Rows.Count > 0 Then
            For Each R As DataRow In Dt.Rows
                If Not R.Item("INVOICES_Id") Is DBNull.Value Then
                    Dim COUNT As Integer = 1
                    If InStr(R.Item("INVOICES_Id"), Req_Id) > 0 Then
                        COUNT = COUNT + 1
                    End If
                    Me.TextBox1.Text = Req_Id & Val(R.Item("INVOICES_Id").ToString) & "-" & Format(COUNT, "0000")
                End If
            Next
        End If
        Conne.Close()
    End Sub
Merci beaucoup d'avance pour l'aide
Amicalement
MADA