Makasih Mas.
----- Original Message -----
From: "wedhi2002" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, February 12, 2008 12:41 PM
Subject: [belajar-access] Re: Jatuh Tempo Angsuran
'---ini cuma buat test----
Function TestfJatuhTempo()
dStart = #1/1/2008#
For i = 1 To 100
'dDate = DateSerial(2008, 1, i)
dDate = DateAdd("d", i - 1, dStart)
jTempo = fJatuhTempoAngsuran(dDate)
Debug.Print Format(dDate, "dd-mmm-yyyy") & "[angsuran tgl : " &
Format(jTempo, "dd-mmm-yyyy") & "]"
Next
End Function
'---------------------------
'Taruh ini di Module Umum
Function fJatuhTempoAngsuran(ByVal TglKredit As Date) As Date
On Error GoTo err_f
Dim TglBulanBerikutnya, Awal2Bln As Date
TglBulanBerikutnya = DateAdd("m", 1, TglKredit)
Bln = Month(TglBulanBerikutnya)
Thn = Year(TglBulanBerikutnya)
Select Case Day(TglKredit)
Case 1 To 10
fJatuhTempoAngsuran = DateSerial(Thn, Bln, 10)
Case 11 To 20
fJatuhTempoAngsuran = DateSerial(Thn, Bln, 20)
Case Else
tgl2BulanBerikutnya = DateAdd("m", 2, TglKredit)
bln2 = Month(tgl2BulanBerikutnya)
thn2 = Year(tgl2BulanBerikutnya)
Awal2Bln = DateSerial(thn2, bln2, 1)
fJatuhTempoAngsuran = DateAdd("d", -1, Awal2Bln)
End Select
exit_f:
Exit Function
err_f:
Debug.Print Err.Description
Resume exit_f
End Function
--- In [email protected], "Dwi Wuryantadi"
<[EMAIL PROTECTED]> wrote:
>
> Dear all,
> Tolongin dong.
> Bagaimana fungsi ntuk mencari tanggal jatuh tempo angsuran 1 dari
suatu
> tanggal kredit.
> Dengan kondisi:
> Tgl Kredit Tgl Jatuh Tempo Angsuran
> 1 s.d. 10 Tgl 10 Bulan Berikutnya
> 11 s.d. 20 Tgl 20 Bulan berikutnya
> 21 s.d. akhir bln Akhir bulan berikutnya
>
> Thanks b 4
>
>
>
> ___________________________________________________________
> All New Yahoo! Mail - Tired of [EMAIL PROTECTED]@! come-ons? Let our
> SpamGuard
protect you. http://uk.docs.yahoo.com/nowyoucan.html
>
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo!
Security Centre. http://uk.security.yahoo.com