Coba pake ini
   
  Sub auto()
Dim urutan As String * 11
Dim hitung As Byte
Dim Nomor As String
Dim No As String
  Dim Panjang as Integer
  
No = "IO-937-000"
With Data1.Recordset
    If .RecordCount = 0 Then
        Nomor = "IO-937-099"
    Else
        .MoveLast
        hitung = Val(Right(.Fields("Nomor"), 3)) + 1
        panjang=Len(No) - Len(CStr(hitung))
          urutan = Left(No,panjang ) & hitung
    End If
        TxtNomor = urutan
    End With
End Sub

mustapa_mail <[EMAIL PROTECTED]> wrote:
          Sub auto()
Dim urutan As String * 11
Dim hitung As Byte
With Data1.Recordset
If .RecordCount = 0 Then
urutan = "IO-937-001"
Else
.MoveLast
hitung = Val(Right(.Fields("Nomor"), 3)) + 1
urutan = Right("IO-937-00" & hitung, 11)
End If
TxtNomor = urutan
End With
End Sub

hasil dari source code diatas sbb:
IO-937-001.tapi waktu urutan 10 ke atas nox IO-937-0010,seharusx IO-
937-010
dan kalo urutan 100 keatas nox IO-937-00100, seharusnya IO-937-100
makasih banyak...
aq baru belajar VB



                         

       
---------------------------------
Bergabunglah dengan orang-orang yang berwawasan, di bidang Anda di Yahoo! 
Answers

[Non-text portions of this message have been removed]

Kirim email ke