SELAMAT DATANG DI BLOG SAYA, SEMOGA BERMANFAAT

Saturday, September 20, 2014

contoh Visual Basic Restorant























Private Sub cmdBERSIH_Click()



Option1 = 0



Option2 = 0



Option3 = 0



Option4 = 0



txtHARGA_PORSI = ""



txtJUMLAH_PORSI = ""



txtBAYAR = ""



txtBONUS = ""



txtPOTONGAN = ""



txtTOT_BAYAR = ""



txtPPN = ""



txtUANG_KEMBALI = ""



txtUANG_BAYAR = ""



End Sub







Private Sub cmdEXIT_Click()



a = MsgBox("Yakin ingin Keluar dari form ini?", vbYesNo + vbInformation, "PESAN")



If a = vbYes Then



End



End If



End Sub







Private Sub cmdHITUNG_Click()



txtBAYAR = Val(txtHARGA_PORSI) * Val(txtJUMLAH_PORSI)











If txtJUMLAH_PORSI >= 10 Then



txtBONUS = "3 Porsi"



txtPOTONGAN = Val(txtBAYAR) * 10 / 100



ElseIf txtJUMLAH_PORSI >= 5 Then



txtBONUS = "1 Porsi"



txtPOTONGAN = Val(txtBAYAR) * 5 / 100



Else



txtBONUS = "Tidak Ada Bonus"



txtPOTONGAN = 0



End If







txtPPN = 10 / 100 * (Val(txtBAYAR) - Val(txtPOTONGAN))



txtTOT_BAYAR = (Val(txtBAYAR) - Val(txtPOTONGAN)) + Val(txtPPN)



txtPPN = Format(txtPPN, "currency")







txtPOTONGAN = Format(txtPOTONGAN, "currency")











txtUANG_BAYAR.SetFocus



End Sub







Private Sub Form_Load()



Option1.Value = 0



Option2.Value = 0



Option3.Value = 0



Option4.Value = 0



End Sub







Private Sub Option1_Click()



txtHARGA_PORSI.Text = 7000



txtJUMLAH_PORSI.SetFocus



End Sub







Private Sub Option2_Click()



txtHARGA_PORSI.Text = 9000







txtJUMLAH_PORSI.SetFocus



End Sub







Private Sub Option3_Click()



txtHARGA_PORSI.Text = 12000







txtJUMLAH_PORSI.SetFocus



End Sub







Private Sub Option4_Click()



txtHARGA_PORSI.Text = 5000







txtJUMLAH_PORSI.SetFocus



End Sub







Private Sub Timer1_Timer()



lbljam.Caption = Format(Time, "hh:mm:ss AM/PM")



lbltgl.Caption = Format(Date, "dd:mm:yy")



End Sub







Private Sub txtJUMLAH_PORSI_Change()



'cmdHITUNG.SetFocus



End Sub







Private Sub txtUANG_BAYAR_Change()



txtUANG_KEMBALI = Val(txtUANG_BAYAR) - Val(txtTOT_BAYAR)



End Sub

No comments:

Post a Comment