Program Login Pom Bensin Menggunakan Visual Basic 6

Share it Please

project ini saya buat 3 form, yaitu form1(login operator1) form2(login operator2) form 3(inti)
untuk form login1 nd 2 cukup menggunakan 1 file simpanan (user nd password) saya coba buat dari ms access.
yg pengen liad disni
download

untuk formnya seperti ini











untuk listingnya;
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "Masukkan Nama Anda", vbInformation, "Confirmation"
Text1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "Masukkan Password Anda", vbCritical, "Confirmation"
Text2.SetFocus
Exit Sub
End If
Adodc1.Recordset.Find "Nama='" & Text1.Text & "'", , adSearchForward, 1
If Not Adodc1.Recordset.EOF Then
If Text2.Text = Adodc1.Recordset!Password Then
MsgBox "Operator 2 silahkan login", vbInformation, "Pesan"
Me.Hide
Form3.Show
Else
MsgBox "password salah..!"
Text2.Text = ""
Text2.SetFocus
End If
Else
MsgBox "AKSES DI TOLAK", vbCritical + vbOKOnly, "iNFO"
Text2 = ""
Text1 = ""
Text1.SetFocus
End If
End Sub


Private Sub Form_Activate()
Text2.Text = ""
Text1.Text = ""
Text1.SetFocus
End Sub

Private Sub Txtpass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1_Click
End If
End Sub

Private Sub txtuser_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
Text1.SetFocus
End If
End Sub

Private Sub Form_Load()
Adodc1.Refresh
End Sub

Private Sub Timer1_Timer()
x = Me.Label4.Caption
y = Left(x, 1)
z = (Right(x, Len(x) - 1))
Me.Label4.Caption = z + y
End Sub

Private Sub Timer2_Timer()
i = i + 1
If i = 1000000 Then i = 0

If i Mod 2 = 0 Then
Label5.Visible = True
Else
Label5.Visible = False
End If
End Sub

form2












listingnya;

Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "Masukkan Nama Anda", vbInformation, "Confirmation"
Text1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "Masukkan Password Anda", vbCritical, "Confirmation"
Text2.SetFocus
Exit Sub
End If
Adodc1.Recordset.Find "Nama='" & Text1.Text & "'", , adSearchForward, 1
If Not Adodc1.Recordset.EOF Then
If Text2.Text = Adodc1.Recordset!Password Then
MsgBox "Selamat Bekerja", vbInformation, "Pesan"
Me.Hide
Form1.Show
Else
MsgBox "password salah..!"
Text2.Text = ""
Text2.SetFocus
End If
Else
MsgBox "AKSES DI TOLAK", vbCritical + vbOKOnly, "iNFO"
Text2 = ""
Text1 = ""
Text1.SetFocus
End If
End Sub


Private Sub Form_Activate()
Text2.Text = ""
Text1.Text = ""
Text1.SetFocus
End Sub

Private Sub Txtpass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1_Click
End If
End Sub

Private Sub txtuser_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
Text1.SetFocus
End If
End Sub

Private Sub Form_Load()
Adodc1.Refresh
End Sub

Private Sub Timer1_Timer()
x = Me.Label4.Caption
y = Left(x, 1)
z = (Right(x, Len(x) - 1))
Me.Label4.Caption = z + y
End Sub

Private Sub Timer2_Timer()
i = i + 1
If i = 1000000 Then i = 0

If i Mod 2 = 0 Then
Label5.Visible = True
Else
Label5.Visible = False
End If
End Sub
 dan yang terakhir form inti



















di form 3 ini juga ada data untuk menyimpan jenis kendaraan, bhan bakar,, disini saya menggunakan ms access,

listingnya;

Private Sub Command1_Click()
Label11.Caption = Label2.Caption
Text4.SetFocus
End Sub



Private Sub Command2_Click()
If Text2 = "" Then
MsgBox "Masukkan uang anda!.", vbInformation, "Error"
Else
Text3.Text = Val(Text2 - Text1)
End If
End Sub

Private Sub Command3_Click()
Label11 = ""
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Combo1 = ""
Combo2 = ""
End Sub

Private Sub Command4_Click()
If Command4.Caption = "Jumlah = Rp" Then
Text4.Text = ""
Text4.SetFocus
Command4.Caption = "/Liter"
Else
Command4.Caption = "Jumlah = Rp"
Text4.Text = ""
Text4.SetFocus
End If
End Sub

Private Sub Command5_Click()
If Command4.Caption = "/Liter" Then
Select Case (Combo2)
Case "Premium"
Text1.Text = Val(Text4) * 4500
Case "Pertamax"
Text1.Text = Val(Text4) * 9500
Case "Solar"
Text1.Text = Val(Text4) * 6500
End Select
Else
Text1.Text = Text4.Text
End If
End Sub

Private Sub Command6_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset!tgl = Label10.Caption
Adodc1.Recordset!jam_masuk = Label11.Caption
Adodc1.Recordset!jenis_kendaraan = Combo1.Text
Adodc1.Recordset!bahan_bakar = Combo2.Text
Adodc1.Recordset!total = Text1.Text
Adodc1.Recordset.Update
End Sub

Private Sub Command7_Click()
x = MsgBox("ingin keluar sekarang??", vbQuestion + vbYesNo, "Pesan")
If x = vbYes Then
End
End If
End Sub

Private Sub Form_Load()
Combo1.Text = "--pilih--"
Combo1.AddItem "Bus"
Combo1.AddItem "Container"
Combo1.AddItem "Truk"
Combo1.AddItem "Mobil"
Combo1.AddItem "Motor"
Combo2.Text = "--pilih--"
Combo2.AddItem "Premium"
Combo2.AddItem "Solar"
Combo2.AddItem "Pertamax"
End Sub

Private Sub Timer1_Timer()
Label10 = Date
Label2 = Time
End Sub

berikut file .exe nya

berhubung uda malem waktunya tidur, bye
yg pengen bilang aja ntr q bikinin, cukup koment aja dibawah postingan vb6.
bye..