Jumat, 21 Februari 2014

Mencari Kuadrat












Private Sub CmdKeluar_Click()
DoCmd.Close
End Sub  

Private Sub Form_Load()
CmdPassword.Caption = "Edit Data"
TxtKuadrat.SetFocus
Me.AllowEdits = False
End Sub

Private Sub CmdPassword_Click()
Dim Password As String
Password = "user"
If CmdPassword.Caption = "Hasil" Then
Me.AllowEdits = False
CmdPassword.Caption = "Edit Data"
TxtHasilKuadrat = Val(TxtKuadrat ^ 2)
Else
If InputBox("Masukkan Password Anda :", "Password") = "user" Then
Me.AllowEdits = True
TxtKuadrat = ""
TxtHasilKuadrat = ""
TxtKuadrat.SetFocus
CmdPassword.Caption = "Hasil"
Else
MsgBox ("Password Anda Salah")
End If
End If
End Sub


Sabtu, 15 Februari 2014

Kalkulator












Private Sub CmdKeluar_Click()
DoCmd.Close
End Sub  

Private Sub Form_Load()
CmdPassword.Caption = "Edit Data"
TxtKuadrat.SetFocus
Me.AllowEdits = False
End Sub

Private Sub CmdPassword_Click()
Dim Password As String
Password = "user"
If CmdPassword.Caption = "Hasil" Then
Me.AllowEdits = False
CmdPassword.Caption = "Edit Data"
TxtHasilKuadrat = Val(TxtKuadrat ^ 2)
Else
If InputBox("Masukkan Password Anda :", "Password") = "user" Then
Me.AllowEdits = True
TxtKuadrat = ""
TxtHasilKuadrat = ""
TxtKuadrat.SetFocus
CmdPassword.Caption = "Hasil"
Else
MsgBox ("Password Anda Salah")
End If
End If
End Sub