1. Dialog Screen Input Customer
Nama Dialog Screen : Form Input Customer
Fungsi : Untuk menginput data kendaraan untuk
disimpan dalam database Bentuk
: Private Sub Combo1_Change
On Error Resume Next Text7 =
Text9 = Text10 =
If Combo1.Text = And Combo2.Text = Then tampil
Else If Combo1.Text = Then
tampil4 Else
If Combo2.Text = Then tampil5
Else tampil3
End If End If
End If
End Sub
Private Sub Combo1_Click On Error Resume Next
Text7 = Text9 =
If Combo1.Text = And Combo2.Text = Then tampil
Else If Combo1.Text = Then
tampil4 Else
If Combo2.Text = Then tampil5
Else tampil3
End If End If
End If
End Sub Private Sub Combo2_Change
On Error Resume Next Text7 =
Text9 = Text10 =
If Combo1.Text = And Combo2.Text = Then tampil
Else If Combo1.Text = Then
tampil4 Else
If Combo2.Text = Then tampil5
Else tampil3
End If End If
End If
End Sub
Private Sub Combo2_Click On Error Resume Next
Text7 = Text9 =
If Combo1.Text = And Combo2.Text = Then tampil
Else If Combo1.Text = Then
tampil4 Else
If Combo2.Text = Then tampil5
Else tampil3
End If End If
End If
End Sub Private Sub Command1_Click
On Error Resume Next Bukakunci Me
non_aktif data1.Enabled = True
auto1
End Sub
Private Sub Command2_Click On Error Resume Next
If Text3 = Or Text2 = Or Text4 = Or Text1 = Or Text5 = Or Text8 = Then MsgBox lengkapi data sebelum disimpan, vbInformation, NS Mobilindo
Else con.Execute exec Sp_Simpan_Customer Text2 , Text1 , Text5 ,
Text8 , Text3 , Text4 MsgBox Data Telah tersimpan, vbInformation, NS Mobilindo
tampil sih
Kunci Me Text7.Locked = False
Text9.Locked = False Text10.Locked = Fals
Combo1.Locked = False Combo2.Locked = False
aktif data1.Enabled = False
End If
End Sub Private Sub Command2_KeyPressKeyAscii As Integer
On Error Resume Next If KeyAscii = 13 Then
If Text3 = Or Text2 = Or Text4 = Or Text1 = Or Text5 = Or Text8 = Then MsgBox lengkapi data sebelum disimpan, vbInformation, NS Mobilindo
Else con.Execute exec Sp_Simpan_Customer Text2 , Text1 , Text5
, Text8 , Text3 , Text4 MsgBox Data Telah tersimpan, vbInformation, NS Mobilindo
tampil Bersih Me
Kunci Me Combo1.Locked = False
Combo2.Locked = False aktif
data1.Enabled = False End If
End If
End Sub
Private Sub Command3_Click On Error Resume Next
If MsgBoxyakin anda akan membatalkan nya, vbYesNo = vbYes Then sih
Kunci Me Text7.Locked = False
Text9.Locked = False Text10.Locked = Fals
aktif data1.Enabled = False
Command1.SetFocus Else
Command3.SetFocus End If
Combo1.Locked = False Combo2.Locked = False
End Sub Private Sub Command4_Click
On Error Resume Next con.Execute update customer set Nama= Text2 ,Tempat_Lahir= Text1
,Tanggal_Lahir= Text5 ,Agama = Text8 ,Alamat= Text3 ,Tlpn= Text4 where Kode_Customer= Text6
MsgBox data telah dirubah, vbInformation, NS Mobilindo tampil
sih Kunci Me
Text7.Locked = False Text9.Locked = False
Text10.Locked = Fals Combo1.Locked = False
Combo2.Locked = False aktif
data1.Enabled = False End Sub
Private Sub Command5_Click On Error Resume Next
con.Execute exec Sp_Hapus_Customer Text6 MsgBox data telah terhapus
tampil sih
Kunci Me Text7.Locked = False
Text9.Locked = False Text10.Locked = Fals
Combo1.Locked = False Combo2.Locked = False
aktif data1.Enabled = False
End Sub Private Sub Command6_Click
On Error Resume Next If MsgBoxyakin anda akan keluar dari form ini, vbYesNo = vbYes Then
sink Me Unload Me
Else Command1.SetFocus
End If
End Sub Private Sub data1_Change
On Error Resume Next Text5 = Yeardata1 - Monthdata1 - Daydata1
Text5.SetFocus
End Sub
Private Sub DataGrid1_Click On Error Resume Next
Text6 = DataGrid1.Columns0 Text2 = DataGrid1.Columns1
Text1 = DataGrid1.Columns2 Text5 = DataGrid1.Columns3
Text8 = DataGrid1.Columns4 Text3 = DataGrid1.Columns5
Text4 = DataGrid1.Columns6 Bukakunci Me
non_aktif Command2.Enabled = False
Command3.Enabled = True Command4.Enabled = True
Command5.Enabled = True
End Sub Private Sub DataGrid1_DblClick
On Error Resume Next If Text11 = Then
Text2.SetFocus Exit Sub
End If Frm_Jual.Text2 = DataGrid1.Columns0
Frm_Jual.Text26 = DataGrid1.Columns1 Frm_Jual.Text29 = DataGrid1.Columns5
Frm_Jual.Text23 = DataGrid1.Columns6 Frm_Jual.Text26.SetFocus
Frm_Jual.Text26.Locked = True Frm_Jual.Option3.Enabled = True
Frm_Jual.Option4.Enabled = True Frm_Jual.Show
Text11 = Unload Me
End Sub
Private Sub DataGrid1_KeyPressKeyAscii As Integer On Error Resume Next
If KeyAscii = 13 Then If Text11 = Then
Text2.SetFocus Exit Sub
End If Frm_Jual.Show
Frm_Jual.Text2 = DataGrid1.Columns0 Frm_Jual.Text26 = DataGrid1.Columns1
Frm_Jual.Text29 = DataGrid1.Columns5 Frm_Jual.Text23 = DataGrid1.Columns6
Frm_Jual.Text26.SetFocus Frm_Jual.Text26.Locked = True
Frm_Jual.Option3.Enabled = True Frm_Jual.Option4.Enabled = True
Text11 = Form1.Visible = False
End If
End Sub Private Sub Form_Load
On Error Resume Next BukaDB
sih Text11 =
Kunci Me Text7.Locked = False
Text9.Locked = False Text10.Locked = False
tampil aktif
data1.Enabled = False Form1.Left = 2685
Form1.Top = 1500 Form1.Width = 9045
Form1.Height = 7620 Form1.ScaleHeight = 7170
Form1.ScaleWidth = 9675 For I = 1 To 31
Combo1.AddItem I Next I
Combo1.Text = DayDate For I = 1 To 12
Combo2.AddItem I Next I
Combo2.Text = MonthDate Combo1.Text =
Combo2.Text = Combo1.Locked = False
Combo2.Locked = False If Combo1.Text = And Combo2.Text = Then
tampil Else
tampil3 End If
End Sub Private Sub tampil
On Error Resume Next Dim rstampil As New ADODB.Recordset
If rstampil.State = 1 Then rstampil.Close rstampil.Open select from customer order by Kode_Customer Desc , con, 3, 2
Set DataGrid1.DataSource = rstampil.DataSource DataGrid1.Refresh
End Sub Private Sub aktif
On Error Resume Next Command1.Enabled = True
Command2.Enabled = False Command3.Enabled = False
Command4.Enabled = False Command5.Enabled = False
Command6.Enabled = True
End Sub Private Sub non_aktif
On Error Resume Next Command1.Enabled = False
Command2.Enabled = True Text2.SetFocus
Command3.Enabled = True Command6.Enabled = False
End Sub
Private Sub Text1_KeyPressKeyAscii As Integer On Error Resume Next
If KeyAscii = 13 Then Text5.SetFocus
End If
End Sub Private Sub Text10_Change
Text9 = Text7 =
Combo1 = Combo2 =
tampil6
End Sub Private Sub Text2_KeyPressKeyAscii As Integer
On Error Resume Next If KeyAscii = 13 Then
Text3.SetFocus Exit Sub
End If If Not KeyAscii = Asca Chr13 _
And KeyAscii = Ascz Chr13 _ Or KeyAscii = AscA Chr13 _
And KeyAscii = AscZ Chr13 _ Or KeyAscii = vbKeyBack _
Or KeyAscii = vbKeyDelete _ Or KeyAscii = vbKeySpace Then
Beep KeyAscii = 0
End If
End Sub Private Sub Text3_KeyPressKeyAscii As Integer
On Error Resume Next If KeyAscii = 13 Then
Text1.SetFocus End If
End Sub
Private Sub Text4_KeyPressKeyAscii As Integer On Error Resume Next
If KeyAscii = 13 Then Command2.SetFocus
Exit Sub End If
If Not KeyAscii = Asc0 Chr13 And KeyAscii = Asc9 Chr13 Or KeyAscii = vbKeyBack Or KeyAscii = vbKeyDelete Or KeyAscii = vbKeySpace Then
Beep KeyAscii = 0
ElseIf KeyAscii = 13 Then Text12.SetFocus
End If
End Sub Sub tampil13
On Error Resume Next Dim rstampil2 As New ADODB.Recordset
If rstampil2.State = 1 Then rstampil2.Close rstampil2.Open select from customer where Alamat like Text9.Text , con, 3,
2 Set DataGrid1.DataSource = rstampil2.DataSource
DataGrid1.Refresh
End Sub Sub tampil6
On Error Resume Next Dim rstampil2 As New ADODB.Recordset
If rstampil2.State = 1 Then rstampil2.Close rstampil2.Open select from customer where Kode_Customer like Text10.Text
, con, 3, 2 Set DataGrid1.DataSource = rstampil2.DataSource
DataGrid1.Refresh
End Sub Sub tampil2
On Error Resume Next Dim rstampil2 As New ADODB.Recordset
If rstampil2.State = 1 Then rstampil2.Close rstampil2.Open select from customer where Nama like Text7.Text , con, 3,
2 Set DataGrid1.DataSource = rstampil2.DataSource
DataGrid1.Refresh
End Sub
Private Sub Text5_KeyPressKeyAscii As Integer On Error Resume Next
If KeyAscii = 13 Then Text8.SetFocus
End If
End Sub Private Sub Text7_Change
On Error Resume Next Text9 =
Text10 = Combo1 =
Combo2 = tampil2
End Sub Private Sub Text9_Change
On Error Resume Next Text7 =
Text10 = Combo1 =
Combo2 = tampil13
End Sub Sub tampil3
On Error Resume Next Dim Rstampil3 As New ADODB.Recordset
If Rstampil3.State = 1 Then Rstampil3.Close Rstampil3.Open select from customer where MonthTanggal_Lahir= Combo2
and DayTanggal_Lahir= Combo1 , con, 3, 2 Set DataGrid1.DataSource = Rstampil3.DataSource
DataGrid1.Refresh
End Sub Sub tampil4
On Error Resume Next Dim Rstampil4 As New ADODB.Recordset
If Rstampil4.State = 1 Then Rstampil4.Close Rstampil4.Open select from customer where MonthTanggal_Lahir= Combo2
, con, 3, 2 Set DataGrid1.DataSource = Rstampil4.DataSource
DataGrid1.Refresh
End Sub
Sub tampil5 On Error Resume Next
Dim Rstampil5 As New ADODB.Recordset If Rstampil5.State = 1 Then Rstampil5.Close
Rstampil5.Open select from customer where dayTanggal_Lahir= Combo1 , con, 3, 2
Set DataGrid1.DataSource = Rstampil5.DataSource DataGrid1.Refresh
End Sub Private Sub Text8_KeyPressKeyAscii As Integer
On Error Resume Next If KeyAscii = 13 Then
Text4.SetFocus End If
End Sub Sub sih
Text2 = Text3 =
Text1 = Text5 =
Text8 = Text4 =
Text6 =
End Sub
2. Dialog Screen Cari Kendaraan