untuk ngecek keberadaan file bisa pake function ini aja
Function FileExists(filename As String) As Boolean
On Error Resume Next
FileExists = (Dir$(filename) <> "")
End Function
jadi sebelum load image tambahin :
if FileExists( App.path & "\Foto Pasien\ & txtkodepasien &".JPG"") then
imgfotopasien. Picture = LoadPicture( App.path & "\Foto Pasien\ & txtkodepasien &".JPG"")
endif
Function FileExists(filename As String) As Boolean
On Error Resume Next
FileExists = (Dir$(filename) <> "")
End Function
jadi sebelum load image tambahin :
if FileExists( App.path & "\Foto Pasien\ & txtkodepasien &".JPG"") then
imgfotopasien. Picture = LoadPicture( App.path & "\Foto Pasien\ & txtkodepasien &".JPG"")
endif
----- Original Message ----
From: mawardi <[EMAIL PROTECTED]>
To: [email protected]
Sent: Thursday, November 2, 2006 4:34:59 PM
Subject: RE: [Programmer-VB] Menghitung Umur...
From: mawardi <[EMAIL PROTECTED]>
To: [email protected]
Sent: Thursday, November 2, 2006 4:34:59 PM
Subject: RE: [Programmer-VB] Menghitung Umur...
ini cara memanggilnya
Usia01
(str(Round(Val( (Now() - CDate(Text2( 3))) / 365),
1)))
Catatan
Untuk CDate(Text2( 3)) merupakan
inputan tanggal lahir
ini function
usia01
Public Function
Usia01(ByVal iInp As String) As String
Dim Num As Single, Pos As Long
Dim Sign As String, Depan As String, Belakang As String
Pos = InStr(iInp, ".")
If Pos > 0 Then
Depan = Mid(iInp, 1, Pos - 1)
Belakang = Mid(iInp, Pos + 1)
Else
Depan = iInp
Belakang = 0
End If
If Val(iInp) < 0 Then
Sign = "-"
Else
Sign = "+"
End If
Text2(4) = Depan
Text2(5) = Belakang
End Function
Dim Num As Single, Pos As Long
Dim Sign As String, Depan As String, Belakang As String
Pos = InStr(iInp, ".")
If Pos > 0 Then
Depan = Mid(iInp, 1, Pos - 1)
Belakang = Mid(iInp, Pos + 1)
Else
Depan = iInp
Belakang = 0
End If
If Val(iInp) < 0 Then
Sign = "-"
Else
Sign = "+"
End If
Text2(4) = Depan
Text2(5) = Belakang
End Function
Semoga berguna dan dapat di
kembangkan
P' Boleh sharing untuk prosess flownya, karena saya
juga lagi ngembangin program untuk rumah sakit yang pernah saya
buat
Salam
Mawardi
-----Original Message-----
From: Hendy Tjondro [mailto:hendy_ [EMAIL PROTECTED] com]
Sent: Thursday, November 02, 2006 21:13
To: Programmer-VB@ yahoogroups. com
Subject: [Programmer- VB] Menghitung Umur...
From: Hendy Tjondro [mailto:hendy_ [EMAIL PROTECTED] com]
Sent: Thursday, November 02, 2006 21:13
To: Programmer-VB@ yahoogroups. com
Subject: [Programmer- VB] Menghitung Umur...
Halo rekan2 milis sekalian...
Saya sedang membuat aplikasi rumah sakit...dan saya ingin menghitung
umur pasien
masalahnya, saya mau output umur pasiennya sbg berikut :
.......Tahun .....Bulan .....Hari
selain itu saya juga mau nanya, bagaimana coding untuk membaca apakah file
txt atau Picture yang berada pada suatu folder ( contoh: Folder Foto
Pasien) itu ada,sehigga pada waktu di load tidak error jika file nya tidak
ada...
contoh coding nya :
Private Cari()
With RsPasien
.Find ! [Kode Pasien] ='"& txtkodepasien &"'",,Forward, 1
txtkodepasien. text = ! [Kode Pasien]
txtnamapasien. text = ! [Nama Pasien]
txtalamatpasien. text = ! [Alamat Pasien]
txtumurpasien. text = ! [Umur Pasien]
txtagamapasien. text = ! [Agama Pasien]
.
.
.
.
.
imgfotopasien. Picture = LoadPicture( App.path & "\Foto Pasien\
& txtkodepasien &".JPG"")
End With
End Sub
mohon bantuan milis sekalian, berserta coding nya..
Terima kasih banyak atas bantuan milis sekalian...
____________ _________ _________ _________ _________ __
Do
You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail. yahoo.com
Access over 1 million songs - Yahoo! Music Unlimited Try it today. __._,_.___
Wahana Programmer Groups Links
<*> Untuk mengunjungi sponsor milis ini, klik link berikut:
http://wahanaprogrammer.net
<*> Untuk menghubungi owner milis ini, kirim email ke:
[EMAIL PROTECTED]
<*> Konsultasi pemrogramman bisa chat disini:
Yahoo! Messenger: wahanaprogrammer
SPONSORED LINKS
| Indonesia phone card | Programmer | Indonesia tour |
| Indonesia travel | Indonesia flower |
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
