Mungkin bisa membantu:
If .RecordCount = 0 Then Text1.Text = "FKT/PNJ" & "/" & tahun & "/" & bulan & "/" & 1 Else .MoveLast tahun = Format(Date, "yy") bulan = Format(Date, "mm") If day(date) = 1 then X = 1 else X = Val(!nomor) + 1 endif Text1.Text = "FKT/PNJ" & "/" & tahun & "/" & bulan & "/" & X End If Salam, edi ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Indra Satriani Sent: Tuesday, February 19, 2008 10:43 AM To: [email protected] Subject: [indoprog-vb] autonumber reset tiap bulan Bagaimana cara membuat kode transaksi yang memuat tahun dan bulan, yang mana jika sudah awal bulan maka nomor urutnya ngulang dari awal lagi, contoh : FKT/PNJ/08/02/0001 FKT/PNJ --> tetap 08 --> tahun 02 --> bulan 0001 --> nomor urut yang saya buat sekarang kalo udah ganti bulan, nomornya nggak ngulang dari awal tapi terus dilanjutin. Itu pun dengan menggunakan tabel bantuan untuk kode transaksinya (isi tabel: tahun, bulan, nomor). Mohon bantuannya dari rekan - rekan sekalian. Terima kasih. berikut source dari fungsi kode transaksi yang sudah saya buat: Sub kodetransaksi() tblnomor.Refresh 'ini kontrol data untuk tabel nomor transaksi With tblnomor.Recordset tahun = Format(Date, "yy") bulan = Format(Date, "mm") If .RecordCount = 0 Then Text1.Text = "FKT/PNJ" & "/" & tahun & "/" & bulan & "/" & 1 Else .MoveLast tahun = Format(Date, "yy") bulan = Format(Date, "mm") X = Val(!nomor) + 1 Text1.Text = "FKT/PNJ" & "/" & tahun & "/" & bulan & "/" & X End If End With End Sub -- I'm normally not a praying man, but if you're up there, please save me Superman. -- Homer Simpson http://bayuindra.com/posts/windows-paselu/ <http://bayuindra.com/posts/windows-paselu/> [Non-text portions of this message have been removed] NOTICE - This message and any attached files may contain information that is confidential and intended only for use by the intended recipient. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, be advised that you have received this message in error and that any dissemination, copying or use of this message or attachment is strictly forbidden, as is the disclosure of the information therein. If you have received this message in error please notify the sender immediately and delete the message. [Non-text portions of this message have been removed]
