Buatlah 2 Form dimana :
- Form 1 Sebagai Menu Transaksi
- Form 2 Sebagai Struk
Object Properties ( Form 1 ):
Label 1 = ( Property - Name : Label1 - Caption : Harga )
Label 2 = ( Property - Name : Label2 - Caption : Jumlah )
Label 3 = ( Property - Name : Label3 - Caption : Total )
TextBox 1 = ( Property - Name : Text1 )
TextBox 2 = ( Property - Name : Text2 )
TextBox 3 = ( Property - Name : Text3 )
Command Button 1 = ( Property - Name : Command1 - Caption : Hitung Total )
Command Button 2 = ( Property - Name : Command1 - Caption : Cetak Struk )
Label 2 = ( Property - Name : Label2 - Caption : Jumlah )
Label 3 = ( Property - Name : Label3 - Caption : Total )
TextBox 1 = ( Property - Name : Text1 )
TextBox 2 = ( Property - Name : Text2 )
TextBox 3 = ( Property - Name : Text3 )
Command Button 1 = ( Property - Name : Command1 - Caption : Hitung Total )
Command Button 2 = ( Property - Name : Command1 - Caption : Cetak Struk )
Contoh Desain Struk Pembayaran :
Object Properties ( Form 2 ):
Label 1 = ( Property - Name : Label1 - Caption : Struk Pembayaran )
Label 2 = ( Property - Name : Label1 - Caption : Harga )
Label 3 = ( Property - Name : Label2 - Caption : Jumlah )
Label 4 = ( Property - Name : Label3 - Caption : Total )
Label 5 = ( Property - Name : HargaLabel - Caption : HargaLabel )
Label 6 = ( Property - Name : JumlahLabel - Caption : JumlahLabel )
Label 7 = ( Property - Name : TotalLabel - Caption : TotalLabel )
Label 2 = ( Property - Name : Label1 - Caption : Harga )
Label 3 = ( Property - Name : Label2 - Caption : Jumlah )
Label 4 = ( Property - Name : Label3 - Caption : Total )
Label 5 = ( Property - Name : HargaLabel - Caption : HargaLabel )
Label 6 = ( Property - Name : JumlahLabel - Caption : JumlahLabel )
Label 7 = ( Property - Name : TotalLabel - Caption : TotalLabel )
(A). Buatlah Sub Statement dengan Kode Berikut ini :
Sub Cetak()
Form2.Show
Form2.HargaLabel.Caption = Me.Text1.Text
Form2.JumlahLabel.Caption = Me.Text2.Text
Form2.TotalLabel.Caption = Me.Text3.Text
End Sub
Form2.Show
Form2.HargaLabel.Caption = Me.Text1.Text
Form2.JumlahLabel.Caption = Me.Text2.Text
Form2.TotalLabel.Caption = Me.Text3.Text
End Sub
(B). Kode Button Hitung Total
Me.Text3.Text = Val(Me.Text1.Text) * Val(Me.Text2.Text)
(C). Kode Button Cetak Struk
Call Cetak
0 Comment:
Post a Comment