Professional Documents
Culture Documents
Database
Nama Tabel : Database_Nilai
Field Name Data Type Field Size
Matematika Number -
Biologi Number -
Kimia Number -
Fisika Number -
Nilai_Akhir Number -
Hasil Short Text 15
FORM
Konfigurasi Form
No Komponen Properties Nilai
1 Label1 Caption Nilai Akhir Ujian
2 Label2 Caption Matematika
3 Label3 Caption Biologi
4 Label4 Caption Fisika
5 Label5 Caption Kimia
6 Label6 Caption Nilai Akhir
7 Label7 Caption (Dikosongkan)
8 Text1 Text (Dikosongkan)
9 Text2 Text (Dikosongkan)
10 Text3 Text (Dikosongkan)
11 Text4 Text (Dikosongkan)
12 Text5 Text (Dikosongkan)
13 Frame Caption Menu
Name CmdHitung
14 CommandButton1
Caption Hitung
Name CmdTambah
15 CommandButton2
Caption Tambah
Name CmdHapus
16 CommandButton3
Caption Hapus
Name CmdKeluar
17 CommandButton4
Caption Keluar
Name Adodc1
18 Adodc
RecordSource Database_Nilai
19 DataGrid DataSource Adodc1
2. Koneksi Adodc Ke Database
a. Klik Kanan Adodc => ADODC Properties
b. Klik Build
c. Pilih Provider = Microsoft.Jet.OLEDB.4.0 => Next => Pilih Database => Test
Connection => OK
Option Explicit
Private Sub cmdHitung_Click()
If Text1.Text = "" Then
MsgBox " Nilai belum diisi!", vbInformation + vbOKOnly, "Perhatian"
Text1.SetFocus
ElseIf Text2.Text = "" Then
MsgBox " Nilai belum diisi!", vbInformation + vbOKOnly, "Perhatian"
Text2.SetFocus
ElseIf Text3.Text = "" Then
MsgBox " Nilai belum diisi!", vbInformation + vbOKOnly, "Perhatian"
Text3.SetFocus
ElseIf Text4.Text = "" Then
MsgBox " Nilai belum diisi!", vbInformation + vbOKOnly, "Perhatian"
Text4.SetFocus
Else
Text5.Text = (Val(Text1) + Val(Text2) + Val(Text3) + Val(Text4)) / 4
CmdTambah.Enabled = True
End If