Você está na página 1de 21

www.konsultasivb.

com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

APLIKASI SERVICE KENDARAAN - VB.NET


Tahapan pembuatan aplikasi service kendaraan adalah sebagai berikut :

1. MEMBUAT PROJECT

a. RUN visual studio sesuai dengan versi yang anda miliki


b. Create project
c. Ketik nama project
d. Klik OK
e. Simpan project di folder tertentu

2. MEMBUAT DATABASE

a. Buka microsoft office sesuai versi yang anda miliki


b. Pilih microsoft access
c. Blank database
d. Browse
e. Pilih folder debug aplikasi
f. Ketik nama database
g. Klik OK

3. MEMBUAT BEBERAPA TABEL

4. MEMBUAT MODULE KONEKSI

a. Kik menu project


b. Add module
c. Ketik nama module
d. Add
e. Ketik coding berikut ini
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Imports System.Data.OleDb
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

Module Module1

Public CONN As OleDbConnection


Public DA As OleDbDataAdapter
Public DS As DataSet
Public CMD As OleDbCommand
Public DR As OleDbDataReader

Public laporan As New ReportDocument


Public TabelLogon As CrystalDecisions.Shared.TableLogOnInfo

Public Sub SetingLaporan()


Dim BacaTabel As CrystalDecisions.CrystalReports.Engine.Table
For Each BacaTabel In laporan.Database.Tables
TabelLogon = BacaTabel.LogOnInfo
With TabelLogon.ConnectionInfo
.ServerName = Application.StartupPath & "\database.mdb"
.UserID = ""
.Password = ""
.DatabaseName = ""
End With
BacaTabel.ApplyLogOnInfo(TabelLogon)
Next BacaTabel
End Sub

Public Sub Koneksi()


CONN = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data
source=database.mdb")
CONN.Open()
End Sub
End Module

5. MEMBUAT FORM LOGIN


www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Imports System.Data.OleDb
Public Class Login

Private Sub txtnama_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtNama.KeyPress
If e.KeyChar = Chr(13) Then
TxtPassword.Focus()
End If
End Sub

Private Sub txtpassword_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TxtPassword.KeyPress
If e.KeyChar = Chr(13) Then
OK.Focus()
End If
End Sub

Private Sub OK_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles OK.Click
Call KONEKSI()
CMD = New OleDbCommand("select * from users where nama_user='" &
txtNama.Text & "' and pwd_user='" & TxtPassword.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
MsgBox("login gagal")
txtNama.Clear()
TxtPassword.Clear()
txtNama.Focus()
Exit Sub
Else
Me.Visible = False
MenuUtama.Show()
MenuUtama.Panel1.Text = DR.Item("kode_user")
MenuUtama.Panel2.Text = DR.Item("nama_user")
MenuUtama.Panel3.Text = UCase(DR.Item("status_user"))

If MenuUtama.Panel3.Text <> "ADMIN" Then


MenuUtama.Button1.Visible = False
End If

End If
End Sub

Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Cancel.Click
End
End Sub
End Class
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

6. MEMBUAT FORM MENU UTAMA

7. MEMBUAT FORM USER


www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Imports System.Data.OleDb

Public Class User

Sub Kosongkan()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
ComboBox1.Text = ""
TextBox1.Focus()
End Sub

Sub DataBaru()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
ComboBox1.Text = ""
TextBox2.Focus()
End Sub

Sub TampilStatus()
CMD = New OleDbCommand("select status_user from users", CONN)
DR = CMD.ExecuteReader
ComboBox1.Items.Clear()
Do While DR.Read
ComboBox1.Items.Add(DR.Item("status_user"))
Loop
End Sub

Sub TampilGrid()
DA = New OleDbDataAdapter("select * from users", CONN)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub

Sub Ketemu()
On Error Resume Next
TextBox2.Text = DR.Item("nama_user")
TextBox3.Text = DR.Item("pwd_user")
ComboBox1.Text = DR.Item("status_user")
TextBox2.Focus()
End Sub

Sub CariData()
CMD = New OleDbCommand("select * from users where kode_user='" &
TextBox1.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
End Sub

Private Sub User_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Call KONEKSI()
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Call Kosongkan()
Call TampilGrid()
Call TampilStatus()
End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = Chr(13) Then
Call CariData()
If DR.HasRows Then
Call Ketemu()
Else
Call DataBaru()
End If
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Try
Call CariData()
If Not DR.HasRows Then
Dim simpan As String = "insert into users values ('" &
TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" &
UCase(ComboBox1.Text) & "')"
CMD = New OleDbCommand(simpan, CONN)
CMD.ExecuteNonQuery()
Else
Dim edit As String = "update users set nama_user='" &
TextBox2.Text & "',pwd_user='" & TextBox3.Text & "',status_user='" &
UCase(ComboBox1.Text) & "' where kode_user='" & TextBox1.Text & "'"
CMD = New OleDbCommand(edit, CONN)
CMD.ExecuteNonQuery()
End If
Call Kosongkan()
Call TampilStatus()
Call TampilGrid()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
If TextBox1.Text = "" Then
MsgBox("kode harus diisi")
TextBox1.Focus()
Exit Sub
End If

Call CariData()
If Not DR.HasRows Then
MsgBox("kode tidak terdaftar")
TextBox1.Clear()
TextBox1.Focus()
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Exit Sub
End If

If MessageBox.Show("yakin akan dihapus...?", "",


MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
Dim hapus As String = "delete * from users where kode_user='" &
TextBox1.Text & "'"
CMD = New OleDbCommand(hapus, CONN)
CMD.ExecuteNonQuery()
Call Kosongkan()
Call TampilGrid()
Call TampilStatus()
Else
Call Kosongkan()
End If
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Call Kosongkan()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
Me.Close()
End Sub

Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles TextBox4.TextChanged
DA = New OleDbDataAdapter("select * from users where nama_user like
'%" & TextBox4.Text & "%'", CONN)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
End Sub

Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As


System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles
DGV.CellMouseClick
On Error Resume Next
TextBox1.Text = DGV.Rows(e.RowIndex).Cells(0).Value
TextBox2.Text = DGV.Rows(e.RowIndex).Cells(1).Value
TextBox3.Text = DGV.Rows(e.RowIndex).Cells(2).Value
ComboBox1.Text = DGV.Rows(e.RowIndex).Cells(3).Value
End Sub
End Class
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

8. MEMBUAT FORM BARANG

9. MEMBUAT FORM JASA


www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

10. MEMBUAT FORM TRANSAKSI SERVICE


www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Imports System.Data.OleDb

Public Class Transaksi

Sub Bersihkan()
TNopol.Clear()
TKeluhan.Text = "-"
TTLBiayaBarang.Text = 0
TTLBiayaService.Text = 0
TTotalharga.Text = 0
TDibayar.Text = 0
TKembali.Text = 0
TCariBarang.Clear()
TCariJasa.Clear()
DGVJasa.Rows.Clear()
DGVBarang.Rows.Clear()
End Sub

Sub Otomatis()
CMD = New OleDbCommand("select nomor from service order by nomor
desc", CONN)
DR = CMD.ExecuteReader
DR.Read()
If Not DR.HasRows Then
TNomor.Text = "00001"
Else
TNomor.Text =
Format(Microsoft.VisualBasic.Right(DR.Item("nomor"), 5) + 1, "00000")
End If
End Sub
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Sub tampilJasa()
DA = New OleDbDataAdapter("select * from jasa", CONN)
DS = New DataSet
DA.Fill(DS)
DGV1.DataSource = DS.Tables(0)
DGV1.ReadOnly = True
End Sub

Sub tampilBarang()
DA = New OleDbDataAdapter("select * from barang where stok>0",
CONN)
DS = New DataSet
DA.Fill(DS)
DGV2.DataSource = DS.Tables(0)
DGV2.ReadOnly = True
End Sub

Private Sub Transaksi_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Call KONEKSI()
Call Otomatis()
TTanggal.Text = Today
Call tampilBarang()
Call tampilJasa()
Call Bersihkan()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Call Bersihkan()
End Sub

Sub TotalBiayaJasa()
Dim hitung As Integer = 0
For baris As Integer = 0 To DGVJasa.RowCount - 1
hitung = hitung + DGVJasa.Rows(baris).Cells(2).Value
TTLBiayaService.Text = FormatNumber(hitung, 0)
Next
End Sub

Sub TotalBiayaBarang()
Dim hitung As Integer = 0
For baris As Integer = 0 To DGVBarang.RowCount - 1
hitung = hitung + DGVBarang.Rows(baris).Cells(4).Value
TTLBiayaBarang.Text = FormatNumber(hitung, 0)
Next
End Sub

Sub HitungTotal()
TTotalharga.Text =
Val(Microsoft.VisualBasic.Str(TTLBiayaService.Text)) +
Val(Microsoft.VisualBasic.Str(TTLBiayaBarang.Text))
TTotalharga.Text = FormatNumber(TTotalharga.Text, 0)
End Sub
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Me.Close()
End Sub

Private Sub TCariJasa_TextChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles TCariJasa.TextChanged
DA = New OleDbDataAdapter("select * from jasa where nama_jasa like
'%" & TCariJasa.Text & "%'", CONN)
DS = New DataSet
DA.Fill(DS)
DGV1.DataSource = DS.Tables(0)
DGV1.ReadOnly = True
End Sub

Private Sub TCariBarang_TextChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles TCariBarang.TextChanged
DA = New OleDbDataAdapter("select * from barang where nama_barang
like '%" & TCariBarang.Text & "%'", CONN)
DS = New DataSet
DA.Fill(DS)
DGV2.DataSource = DS.Tables(0)
DGV2.ReadOnly = True

End Sub

Private Sub TDibayar_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TDibayar.KeyPress
If e.KeyChar = Chr(13) Then
TDibayar.Text = FormatNumber(TDibayar.Text, 0)
If Val(Microsoft.VisualBasic.Str(TDibayar.Text)) <
Val(Microsoft.VisualBasic.Str(TTotalharga.Text)) Then
MsgBox("Pembayaran kurang")
Exit Sub
ElseIf Val(Microsoft.VisualBasic.Str(TDibayar.Text)) >=
Val(Microsoft.VisualBasic.Str(TTotalharga.Text)) Then
TKembali.Text =
Val(Microsoft.VisualBasic.Str(TDibayar.Text)) -
Val(Microsoft.VisualBasic.Str(TTotalharga.Text))
TKembali.Text = FormatNumber(TKembali.Text, 0)
'Button1.Enabled = True
End If
Button1.Focus()
End If

If Not (e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar =


vbBack) Then
e.Handled = True
End If
End Sub

Private Sub TNopol_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TNopol.KeyPress
If e.KeyChar = Chr(13) Then
TNopol.Text = UCase(TNopol.Text)
TKeluhan.Focus()
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

End If
End Sub

Private Sub DGVJasa_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles DGVJasa.KeyPress
On Error Resume Next
If e.KeyChar = Chr(27) Then
DGVJasa.Rows.RemoveAt(DGVJasa.CurrentCell.RowIndex)
Call TotalBiayaJasa()
Call HitungTotal()
End If
End Sub

Private Sub DGVBarang_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles DGVBarang.KeyPress
On Error Resume Next
If e.KeyChar = Chr(27) Then
DGVBarang.Rows.RemoveAt(DGVBarang.CurrentCell.RowIndex)
Call TotalBiayaBarang()
Call HitungTotal()
End If
End Sub

Private Sub DGV1_CellMouseClick(ByVal sender As Object, ByVal e As


System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles
DGV1.CellMouseClick
On Error Resume Next
Dim baris As Integer = DGVJasa.RowCount - 1
DGVJasa.Rows.Add(DGV1.Rows(e.RowIndex).Cells(0).Value)

For i As Integer = 0 To DGVJasa.RowCount - 1


For j As Integer = i + 1 To DGVJasa.RowCount - 1
If DGVJasa.Rows(j).Cells(0).Value =
DGVJasa.Rows(i).Cells(0).Value Then
MsgBox("data sudah dientri")
DGVJasa.Rows.RemoveAt(j)
Exit Sub
End If
Next
Next

CMD = New OleDbCommand("select * from jasa where kode_jasa='" &


DGVJasa.Rows(baris).Cells(0).Value & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
DGVJasa.Rows(baris).Cells(1).Value = DR.Item("nama_jasa")
DGVJasa.Rows(baris).Cells(2).Value = DR.Item("harga_jasa")
DGVJasa.Columns(2).DefaultCellStyle.Format = "###,###,###"
DGVJasa.Columns(2).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
End If
Call TotalBiayaJasa()
Call HitungTotal()
TCariJasa.Clear()
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

End Sub

Private Sub DGV2_CellMouseClick(ByVal sender As Object, ByVal e As


System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles
DGV2.CellMouseClick
Dim baris As Integer = DGVBarang.RowCount - 1
DGVBarang.Rows.Add(DGV2.Rows(e.RowIndex).Cells(0).Value)

For i As Integer = 0 To DGVBarang.RowCount - 1


For j As Integer = i + 1 To DGVBarang.RowCount - 1
If DGVBarang.Rows(j).Cells(0).Value =
DGVBarang.Rows(i).Cells(0).Value Then
MsgBox("data sudah dientri")
DGVBarang.Rows.RemoveAt(j)
Exit Sub
End If
Next
Next

CMD = New OleDbCommand("select * from Barang where kode_Barang='" &


DGVBarang.Rows(baris).Cells(0).Value & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
DGVBarang.Rows(baris).Cells(1).Value = DR.Item("nama_Barang")
DGVBarang.Rows(baris).Cells(2).Value = DR.Item("harga_Barang")
DGVBarang.Columns(2).DefaultCellStyle.Format = "###,###,###"
DGVBarang.Columns(2).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
DGVBarang.Rows(baris).Cells(3).Value = 1
DGVBarang.Columns(3).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleCenter
DGVBarang.Rows(baris).Cells(4).Value =
DGVBarang.Rows(baris).Cells(2).Value * DGVBarang.Rows(baris).Cells(3).Value
DGVBarang.Columns(4).DefaultCellStyle.Format = "###,###,###"
DGVBarang.Columns(4).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
End If
Call TotalBiayaBarang()
Call HitungTotal()
TCariBarang.Clear()
End Sub
End Class
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

11. MEMBUAT LAPORAN MASTER

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
laporan.Load("barang.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
laporan.Load("jasa.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub

12. MEMBUAT LAPORAN SERVICE


www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

LAPORAN DATA SERVICE PERIODIK

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
CRV.SelectionFormula = "{service.tanggal} in date ('" & DTP2.Text &
"') to date ('" & DTP3.Text & "')"
laporan.Load("MASTER SERVICE.rpt")
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub

LAPORAN DATA SERVICE PER NOMOR POLISI

Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged
CRV.SelectionFormula = "{service.NOMOR_polisi} = '" & ListBox2.Text
& "'"
laporan.Load("per nomor polisi.rpt")
Call SetingLaporan()
CRV.ReportSource = laporan
CRV.RefreshReport()
End Sub

13. MEMBUAT HISTORI SERVICE


www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Imports System.Data.OleDb

Public Class HistoriService

Sub Kosongkan()
ComboBox1.Text = ""
TTanggal.Text = ""
TNopol.Text = ""
TKeluhan.Text = ""
TBiayaService.Text = ""
TBiayaBarang.Text = ""
TTotalharga.Text = ""
TDibayar.Text = ""
TKembali.Text = ""
End Sub

Sub TampilData()
TTanggal.Text = DR.Item("tanggal")
TNopol.Text = DR.Item("nomor_polisi")
TKeluhan.Text = DR.Item("keluhan")
TBiayaService.Text = DR.Item("biaya_jasa")
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

TBiayaBarang.Text = DR.Item("biaya_barang")
TTotalharga.Text = DR.Item("total_harga")
TDibayar.Text = DR.Item("dibayar")
TKembali.Text = DR.Item("kembali")
End Sub

Sub DetailJasa()
DA = New OleDbDataAdapter("select Nama_jasa,harga_jasa from
jasa,detailjasa where jasa.kode_jasa=detailjasa.kode_jasa and nomor='" &
ComboBox1.Text & "'", CONN)
DS = New DataSet
DA.Fill(DS)
DGVJasa.DataSource = DS.Tables(0)
DGVJasa.ReadOnly = True
DGVJasa.Columns(0).HeaderText = "Nama Jasa"
DGVJasa.Columns(1).HeaderText = "Harga"
DGVJasa.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
End Sub

Sub DetailBarang()
DA = New OleDbDataAdapter("select
barang.nama_barang,harga_barang,detailbarang.Jumlah,Total from
barang,detailbarang where barang.kode_barang=detailbarang.kode_barang and
nomor='" & ComboBox1.Text & "'", CONN)
DS = New DataSet
DA.Fill(DS)
DGVBarang.DataSource = DS.Tables(0)
DGVBarang.ReadOnly = True

DGVBarang.Columns(0).HeaderText = "Nama Barang"


DGVBarang.Columns(1).HeaderText = "Harga Barang"
DGVBarang.AutoSizeColumnsMode =
DataGridViewAutoSizeColumnsMode.Fill

End Sub

Sub BersihkanDuaGrid()
DGVJasa.Columns.Clear()
DGVBarang.Columns.Clear()
End Sub

Private Sub HistoriService_Load(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles MyBase.Load
Call KONEKSI()
CMD = New OleDbCommand("select nomor from service", CONN)
DR = CMD.ExecuteReader
Do While DR.Read
ComboBox1.Items.Add(DR.Item(0))
Loop
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Call Kosongkan()
Call BersihkanDuaGrid()
End Sub
www.konsultasivb.com
Pusat Kursus VB.Net & Bimbingan Tugas Akhir

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Me.Close()
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectedIndexChanged
CMD = New OleDbCommand("select * from service where nomor='" &
ComboBox1.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
Call TampilData()
Call DetailJasa()
Call DetailBarang()
Else
Call Kosongkan()
Call BersihkanDuaGrid()
MsgBox("Data tidak ditemukan")
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Cetak.Show()
Cetak.CRV.SelectionFormula = "{service.NOMOR} = '" & ComboBox1.Text
& "'"
laporan.Load("MASTER service.rpt")
Call SetingLaporan()
Cetak.CRV.ReportSource = laporan
Cetak.CRV.RefreshReport()
End Sub
End Class