Call koneksi() sql = "select * from penjualan order by no_faktur desc" cmd = New OleDbCommand(sql, conn) dr = cmd.ExecuteReader dr.Read() If Not dr.HasRows Then penfaktur.Text = "PL" + Format(Now, "ddMMyyyy") + "0001" Else penfaktur.Text = Val(Microsoft.VisualBasic.Mid(dr.Item("no_faktur").ToString, 11, 4)) + 1 End If If Len(penfaktur.Text) = 1 Then penfaktur.Text = "PL" + Format(Now, "ddMMyyyy") + "000" & penfaktur.Text & "" ElseIf Len(penfaktur.Text) = 2 Then penfaktur.Text = "PL" + Format(Now, "ddMMyyyy") + "00" & penfaktur.Text & "" ElseIf Len(penfaktur.Text) = 3 Then penfaktur.Text = "PL" + Format(Now, "ddMMyyyy") + "0" & penfaktur.Text & "" ElseIf Len(penfaktur.Text) = 4 Then penfaktur.Text = "PL" + Format(Now, "ddMMyyyy") + "" & penfaktur.Text & "" End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)