Thursday, April 3, 2014

Mencari Luas Lingkaran



Option Compare Database

Private Sub CmdHapus_Click()
TxtJari = ""
TxtHasil = ""
End Sub

Private Sub CmdHitung_Click()
Dim R As Integer
R = TxtJari
Hasil = (22 / 7) * R
TxtHasil = Hasil
End Sub

Private Sub CmdKeluar_Click()
DoCmd.Save
  DoCmd.Close
End Sub

Thursday, March 13, 2014

Mencari Luas Pesergi Panjang

Private Sub CmdHapus_Click()
TxtPanjang = ""
TxtLebar = ""
Txthasil = ""
End Sub

Private Sub CmdHitung_Click()
Dim P, L, H As Integer
P = TxtPanjang
L = TxtLebar
H = P * L
Txthasil = H
End Sub

Private Sub CmdKeluar_Click()
DoCmd.Save
DoCmd.Close
End Sub

Thursday, March 6, 2014

Konversi Suhu




Private Sub CmdHapus_Click()
TxtCelcius = ""
TxtReamur = ""
TxtFahrenheit = ""
TxtKelvin = ""
TxtCelcius.SetFocus
End Sub

Private Sub CmdHitung_Click()
Dim C, R, F, K As Integer
C = TxtCelcius
R = (4 / 5) * C
F = (9 / 5) * C + 32
K = C + 273
TxtReamur = R
TxtFahrenheit = F
TxtKelvin = K
End Sub

Private Sub CmdKeluar_Click()
DoCmd.Save
DoCmd.Close
End Sub

Thursday, February 13, 2014

Kalkulator



Private Sub CmdBagi_Click()
    Bil1 = Val(TxtBil1)
    Bil2 = Val(TxtBil2)
 If Bil2 = 0 Then
     MsgBox ("Bilangan 2 tidak boleh Nol")
 Else
    Hasil = Bil1 / Bil2
    TxtHasil = Hasil
 End If
End Sub

Private Sub CmdHapus_Click()
 TxtBil1 = ""
 TxtBil2 = ""
 TxtHasil = ""
 TxtBil1.SetFocus
End Sub

Private Sub CmdKali_Click()
    Bil1 = Val(TxtBil1)
    Bil2 = Val(TxtBil2)
    Hasil = Bil1 * Bil2
    TxtHasil = Hasil
End Sub

Private Sub CmdKeluar_Click()
    DoCmd.Save
    DoCmd.Close
End Sub

Private Sub CmdKurang_Click()
    Bil1 = Val(TxtBil1)
    Bil2 = Val(TxtBil2)
    Hasil = Bil1 - Bil2
    TxtHasil = Hasil
End Sub

Private Sub CmdTambah_Click()
    Bil1 = Val(TxtBil1)
    Bil2 = Val(TxtBil2)
    Hasil = Bil1 + Bil2
    TxtHasil = Hasil
End Sub