Berikut adalah program untuk
mengetahui resep-resep masakan dan jenis masakan dengan menggunakan Bahasa Pemrograman Visual
Basic 6.
Di Form menu utama terdapat 3 menu,
dimana sub menu dari menu Resep Masakan adalah
Resep Masakan dan Jenis Masakan. Sub menu Resep Masakan dipergunakan
user untuk
menginputkan bahan, dan cara memasak. Didalam sub menu Jenis Masakan digunakan untuk mengetahui bahan dari jenis masakan yang diinputkan. Kemudian ada Menu About dan Menu Exit.
menginputkan bahan, dan cara memasak. Didalam sub menu Jenis Masakan digunakan untuk mengetahui bahan dari jenis masakan yang diinputkan. Kemudian ada Menu About dan Menu Exit.
Tampilan Output
a. Tampilan Output Menu Utama
code source :
Private Sub mjenis_Click()
Form2.Show
End Sub
Private Sub mResep_Click()
Form1.Show
End Sub
Private Sub mtambh_Click()
Form3.Show
End Sub
b. Tampilan Pembuatan Menu Utama
c. Tampilan Output Menu Resep Masakan
code source :
Private Sub Command1_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset!jenis_makanan = tjenis.Text
Adodc1.Recordset!nama_masakan = tnama.Text
Adodc1.Recordset!bahan = tbahan.Text
Adodc1.Recordset!cara_memasak = tcara.Text
Adodc1.Recordset.Update
MsgBox " Data Sudah Di simpan ..!!"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Form2.Show
End Sub
Private Sub Form_Load()
Adodc1.RecordSource = "Select * From resep"
Adodc1.Refresh
End Sub
d. Tampilan Output Jenis Masakan
Code source :
Private Sub bttampil_Click()
Adodc1.RecordSource = "Select * From Resep where jenis_makanan='" & tjenis.Text & "'"
Adodc1.Refresh
While Not Adodc1.Recordset.EOF
fg1.Row = baris
fg1.Col = 0
fg1.Text = baris
fg1.Col = 1
fg1.Text = Adodc1.Recordset!nama_masakan
Adodc1.Recordset.MoveNext
baris = baris + 1
Wend
End Sub
Private Sub Command1_Click()
Form3.Show
End Sub
Private Sub Form_Load()
fg1.Row = 0
fg1.Col = 0
fg1.Text = "No"
fg1.Col = 1
fg1.Text = "Bahan"
fg1.ColWidth(0) = 500
fg1.ColWidth(1) = 2500
End Sub
e. Tampilan Output Tambah Jenis Masakan
Private Sub CTambah_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset!jenis_masakan = tjenis.Text
Adodc1.Recordset.Update
MsgBox "Data Sudah Di Simpan!!!"
End Sub
Private Sub Command2_Click()
MDIForm1.Show
End Sub
Private Sub Form_Load()
Adodc1.RecordSource = "select * From resep"
Adodc1.Refresh
End Sub
e. Tampilan Output Untuk Mencari Nama Makanan
Source kode
Private Sub ccari_Click()
Adodc1.RecordSource = "Select * From Makanan where Nama_makanan like '%" & tcari.Text & "%'"
Adodc1.Refresh
baris = 1
While Not Adodc1.Recordset.EOF
fg1.Rows = fg1.Rows + 1
fg1.Row = baris
fg1.Col = 0
fg1.Text = baris
fg1.Col = 1
fg1.Text = Adodc1.Recordset!nama_makanan
fg1.Col = 2
fg1.Text = Adodc1.Recordset!harga
fg1.Col = 3
fg1.Text = Adodc1.Recordset!Asal
Adodc1.Recordset.MoveNext
baris = baris + 1
Wend
End Sub
Private Sub Command1_Click()
Form3.Show
End Sub
Private Sub Form_Load()
fg1.Row = 0
fg1.Col = 0
fg1.Text = "No"
fg1.Col = 1
fg1.Text = "Nama Makanan"
fg1.Col = 2
fg1.Text = "harga"
fg1.Col = 3
fg1.Text = "Asal"
fg1.ColWidth(0) = 500
fg1.ColWidth(1) = 2500
fg1.ColWidth(2) = 1500
fg1.ColWidth(3) = 2500
End Sub
Private Sub ccari_Click()
Adodc1.RecordSource = "Select * From Makanan where Nama_makanan like '%" & tcari.Text & "%'"
Adodc1.Refresh
baris = 1
While Not Adodc1.Recordset.EOF
fg1.Rows = fg1.Rows + 1
fg1.Row = baris
fg1.Col = 0
fg1.Text = baris
fg1.Col = 1
fg1.Text = Adodc1.Recordset!nama_makanan
fg1.Col = 2
fg1.Text = Adodc1.Recordset!harga
fg1.Col = 3
fg1.Text = Adodc1.Recordset!Asal
Adodc1.Recordset.MoveNext
baris = baris + 1
Wend
End Sub
Private Sub Command1_Click()
Form3.Show
End Sub
Private Sub Form_Load()
fg1.Row = 0
fg1.Col = 0
fg1.Text = "No"
fg1.Col = 1
fg1.Text = "Nama Makanan"
fg1.Col = 2
fg1.Text = "harga"
fg1.Col = 3
fg1.Text = "Asal"
fg1.ColWidth(0) = 500
fg1.ColWidth(1) = 2500
fg1.ColWidth(2) = 1500
fg1.ColWidth(3) = 2500
End Sub
Tidak ada komentar:
Posting Komentar