Bisa dicoba script di bawah ini.

Dim sCode as String,
sCode = "FP-" & Format(Date,"dd")
If rsmh.RecordCount = 0 Then
tfper.Text = sCode & "0001"
Else
rsmh.MoveLast
tfper.Text = sCode & Format((Val(Right(rsmh!no_fp, 4)) + 1),"0000")
End If

* Pastikan hasil seleksi recordset yang di cek dengan command .RecordCount
adalah recordset yang sudah diseleksi per tanggal (Date), kalau tidak, indek
nomer urut tidak kembali nol meski tanggal sudah berubah.

SELECT <tabel> no_fp WHERE LEFT(no_fp,5) = sCode ORDER BY no_fp

Salam,
Newbie

2008/4/10 tepupunk <[EMAIL PROTECTED]>:

>   all gw da masalah sama bikin format untuk faktur..
> faktur yg di inginkan ada lah
> FP=xxyyyy
> xx=tanggal -->2 dijit
> yyyy=no urut -->4 dijit
>
> gw punya script gini...
>
> Dim fakper
> If rsmh.RecordCount = 0 Then
> tfper.Text = "FP-" & Val(Left(TTANGGAL, 2)) & "0001"
> Else
> rsmh.MoveLast
> gg = Left(TTANGGAL, 2)
> fakper = Left(rsmh!no_fp, 3) & gg & _
> Right(rsmh!no_fp, 4) + 1
> tfper.Text = Format(fakper, "FP-000000")
> End If
>
> hasil nya adalah = FP-xxyy >> tanggal dan no urut aja
> 2 dijit
> sedangkan untuk no urut ada 4 dijit
> klo di fakper nya di tambah & "0000"
> hasil nya akan FP-100001 >>masalah nya klo no urut nya
> 10 ato 2 dijit
> si "0000" ga mo berkurang....
>
> ada yg punya solusi..??
>
> thx b4
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>  
>


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

Kirim email ke