Sedikit tambahan, usahakan untuk menghindari penggunaan nama field yang mungkin digunakan dalam sebuah fungsi (no, date, year, month, day, dsb...) ini akan menjadikan kepala kita pusing. Sebenernya kalo diganti nama fieldnya jadi noID dan sedikit perubahan
strDummy = Nz(DMax("RIGHT(noid,4)", "Tinput", "noid Like '" & Format(TGL, "dd") & Format(TGL, "mm") & Format(TGL, "yyyy") & "*'"), "")
kemudian gunakan
If strDummy = "0" Then
daripada
If strDummy = "" Then
karena sudah di NZ
sudah bisa jalan.
silakan dicoba...
--- In belajar-access@yahoogroups.com, Afrizal <aflazio7@...> wrote:
>
> terima kasih masukannya mas...
> saya coba dulu ya
>
> thank
> Afrizal
>
> --- On Tue, 10/1/12, Coyev <coyev@...> wrote:
>
> From: Coyev <coyev@...>
> Subject: [belajar-access] Re: (Tanya) no registrasi
> To: belajar-access@yahoogroups.com
> Date: Tuesday, 10 January, 2012, 9:10 AM
>
>
>
>
>
>
>
>
> Â
>
>
>
>
>
>
>
>
>
> Coba kl fungsinya jadi begini:
>
>
>
> Public Function GetNo(pTGL As Date) As String
>
> Dim strDummy As String
>
> strDummy = Nz(DMax("right([no],4)", "Tinput", "left([no],8)='" & Format(pTGL, "ddmmyyyy") & "'"))
>
> If strDummy = "" Then
>
> GetNo = Format(pTGL, "dd") & Format(pTGL, "mm") & Format(pTGL, "yyyy") & "0001"
>
> Else
>
> GetNo = Format(pTGL, "dd") & Format(pTGL, "mm") & Format(pTGL, "yyyy") & Format(Val(strDummy) + 1, "0000")
>
> End If
>
> End Function
>
>
>
> Smoga bermanfaat.
>
>
>
> Salam,
>
> Coyev
>
>
>
> --- In belajar-access@yahoogroups.com, Afrizal <aflazio7@> wrote:
>
> >
>
> >
>
> > para master access
>
> >
>
> > saya ada masalah untuk membuat no registrasi. saya mendapat contoh dr milis ini. tp pada saat saya praktek dalam form sy no registrasi ya selalu di satu nomor aja tidak berganti.
>
> > contoh no ya.
>
> > 080120120001
>
> > seharusnya akan berlanjut ke 080120120002. tp yg tampil tetap no 080120120001.
>
> >
>
> >
>
> > mohon solusi ya.... (file terlampir)
>
> >
>
> > terima kasih banyak
>
> >
>
> > Afrizal
>
> >
>
Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
No comments:
Post a Comment