--- In [email protected], "Don Rudy" <[EMAIL PROTECTED]> wrote:
>
> 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]
>
mungkin bisa dicoba seperti berikut ini :
if ((KeyAscii >= vbKey0) and (KeyAscii <= vbKey9)) or (KeyAscii =
vbKeyBack) or (KeyAscii = Asc(".")
--
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/