Wednesday, May 21, 2014

Data Toko ala Sang Bocah

Form data pembelian Option Compare DatabasePrivate Sub Form_Load()    Me.TxtTanggal1.Value = Date    Me.TxtTanggal2.Value = Date    Me.RecordSource = "SELECT * FROM t_beli WHERE tanggal>=#" & Me.TxtTanggal1.Value & "# AND tanggal<=#" & Me.TxtTanggal2.Value & "#"End SubPrivate Sub TxtFilter_AfterUpdate()    If Me.TxtFilter.Value <> "" Then       ...

Luas Persegi Panjang ala Sang Bocah

Option Compare DatabasePrivate Sub CmdClose_Click()DoCmd.SaveDoCmd.CloseEnd SubPrivate Sub CmdHapus_Click()TxtPanjang = ""TxtLebar = ""TxtLuas = ""TxtPanjang.SetFocusEnd SubPrivate Sub CmdHitung_Click()Dim P, L, S As IntegerP = TxtPanjangL = TxtLebarTxtLuas = STxtPanjang = PTxtLebar = LTxtLuas = P * LEnd ...

Luas Segitiga ala Sang Bocah

Option Compare Database Private Sub CboAlas_Change()   LblAlas.Caption = CoboAlas End Sub Private Sub CboTinggi_Change()   LblTinggi.Caption = CboTinggi End Sub Private Sub CmdHapus_Click()   CboAlas = ""   CboTinggi = ""   TxtHasil = ""   LblAlas.Caption = "Isi Alas"   LblTinggi.Caption = "Isi Tinggi"   CboAlas.SetFocus End Sub Private Sub CmdHitung_Click()   If CboAlas = "" Or CboTinggi = "" Then    ...

Wednesday, April 2, 2014

Luas Trapesium ala Sang Bocah

Private Sub CmdHapus_Click() TxtSejajar = "" TxtTinggi = "" TxtHasil = "" TxtSejajar.SetFocus End Sub Private Sub CmdHitung_Click() Dim S, t, H As Integer S = TxtSejajar t = TxtTinggi H = TxtSejajar * TxtTinggi / 2 TxtSejajar = S TxtTinggi = t TxtHasil = H End Sub Private Sub CmdKeluar_Click() DoCmd.Save DoCmd.Close End ...

Wednesday, March 5, 2014

Konversi Suhu ala Sang Bocah

Private Sub CmdHapus_Click()TxtCelcius = ""TxtFahranheit = ""TxtKelvin = ""TxtReamur = ""End SubPrivate Sub CmdHitung_Click()Dim C, R, F, K As IntegerC = TxtCelciusR = (4 / 5 * C)F = (9 / 5 * C) + 32K = (C + 273)TxtReamur = RTxtFahranheit = FTxtKelvin = KEnd SubPrivate Sub CmdKeluar_Click()DoCmd.SaveDoCmd.Close End ...

Wednesday, February 19, 2014

Cari Kuadrat ala Sang Bocah

Private Sub Form_Load()CmdPassword.Caption = "Edit Data" 'Posisi caption tombol pertama kaliMe.AllowEdits = False 'Form tidak dapat di editEnd SubPrivate Sub CmdPassword_Click()Dim Password As StringPassword = "user" ' Isi variable passwordIf CmdPassword.Caption = "Hasil" Then 'Menguji caption tombol   Me.AllowEdits = False   CmdPassword.Caption = "Edit Data" 'Mengembalikan caption semula   TxtHasilKuadrat = Val(TxtKuadrat...

Wednesday, February 12, 2014

Kalkulator ala Sang Bocah

Private Sub CmdBagi_Click() Bil1 = Val(TxtBil1) Bil2 = Val(TxtBil2) Hasil = Bil1 / Bil2 TxtHasil = Hasil 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...