Membuat Nomor Otomatis

Tulis listing ini...
Private Sub nomor()
Dim no As StringWith Data1If .Recordset.RecordCount <> 0 Then
.Recordset.MoveLastno = Val(Right(.Recordset!kdpasen, 4)) + 1
If Len(Trim(no)) = 1 ThenText1.Text = "P" + "000" + noEnd If
If Len(Trim(no)) = 2 ThenText1.Text = "P" + "00" + noEnd If
If Len(Trim(no)) = 3 ThenText1.Text = "P" + "0" + noEnd If
If Len(Trim(no)) = 4 ThenText1.Text = "P" + noEnd If
ElseText1.Text = "P0001"End If
End With
End Sub
Buat command dengan nama tambah lalau panggil listing di atas dengan mengetik call nomor
call nomor

0 komentar: