Coba pake Ascii Numbernya aja... Jangan pake vbkey... Pasti Bisa

----- Original Message ----
From: Don Rudy <[EMAIL PROTECTED]>
To: itcenter@yahoogroups.com
Sent: Tuesday, March 6, 2007 2:22:28 PM
Subject: [ITCENTER] [IT-CENTER]Tanya - Visual Basic 6.0

Dear All, saya perlu bantuan nich. Semoga ada yang mau bantu.
Saya sedang membuat aplikasi payroll di kantor menggunakan Visual Basic.
Untuk input angka saya menggunakan KeyAscii supaya karakter lain(selain
angka) tidak bisa diinput. Masalahnya adalah angka yang dimasukkan
seharusnya bisa Decimal(dengan menggunakan "."), saya sudah mencoba
menggunakan VbKeyDecimal tapi tidak berfungsi...
Saya inputkan "." tetap muncul MsgBox, berikut ini saya sertakan code-nya.
Thanks.

Private Sub txt_jamlembur_ KeyPress( KeyAscii As Integer)
On Error Resume Next
If ((KeyAscii >= vbKey0) And (KeyAscii <= vbKey9)) Or (KeyAscii =
vbKeyBack) Or (KeyAscii = vbKeyDecimal) Then
Exit Sub
Else
MsgBox ("Anda harus memasukkan angka."), vbOKOnly + vbExclamation,
"Peringatan"
KeyAscii = vbKeyBack
End If
On Error GoTo 0
End Sub

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





 
____________________________________________________________________________________
Don't get soaked.  Take a quick peak at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

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



-- 
www.itcenter.or.id - Komunitas Teknologi Informasi Indonesia 
Gabung, Keluar, Mode Kirim : [EMAIL PROTECTED] 
## Jobs: itcenter.or.id/jobs ## Bursa: itcenter.or.id/bursa ##

## Jaket ITCENTER tersedia di http://shop.itcenter.or.id 
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ITCENTER/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ITCENTER/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Kirim email ke