LAMPIRAN -LAMPIRAN                                                                         Lampiran 1                     ...
If Not rsPass.EOF Then Label3.Caption =   End SubrsPass!UserIf txtuser.Text = Label3.Caption Thentxtpas.SetFocus
Lampiran 2                             Sourcecode Menu UtamaDim strTemp, LenTemp, n                     LenTemp = Len(strT...
gantip.Show     X = MsgBox("Apakah anda ingin                keluar dari aplikasi ini?", _  Utama.Hide                  vb...
Lampiran 3                                    Source code POSSDim strTemp, LenTemp, n                        Private Sub h...
Set rspos = Nothing                      "Kemudian click hapus", vbInformation,                                         "S...
Private Sub cmdKeluark_Click(Index As     " ulangi pemasukkan data",Integer)                                  vbExclamatio...
Loop                                    rspos.Find "KodeNopen=" +                                        txtkode.Text + ""...
If cmdsimpann.Caption = "&Edit" Then     End Subhubungno                                 Private Sub Text3_Change()rspos.U...
Private Sub cmdsimpanp_Click()               ResetIf cmdsimpanp.Caption = "&Simpan"            txtnop.SetFocusThen        ...
POS.CursorLocation = adUseClient           cmbthn.AddItem 2010POS.Open App.Path & "/" &                  cmbthn.AddItem 20...
End Sub                                    bersih.Enabled = TruePrivate Sub txtcari_Change()               End SubSet rspo...
cmbhrgmaterai.Text = ""                bersih.Enabled = Falsetxtdipenuhim.Text = ""                 cmdsimpanm.Caption = "...
List.SubItems(3) = rspos!Dipenuhik   txtnok.Text = rspos!NokList.SubItems(4) = rspos!Bsuk        cmbkon.Text = rspos!Konsi...
Else                                        Private Sub txtkode_KeyPress(KeyAscii                                         ...
End Sub                                Txtnopenm.Text = ""Private Sub txtnom1_Change()           End IfSet rspos = Nothing...
Lampiran 4                               Sourcecode Ganti PassowordDim Ganti As New ADODB.Connection              txtbru2....
Else                                         Ganti.Open App.Path & "/" &                                             "db_p...
Private Sub txtus_Change()Set rsGanti = NothingrsGanti.Open "Login", Ganti,adOpenDynamic, adLockOptimisticrsGanti.Find "Us...
Upcoming SlideShare
Loading in …5
×

Lampiran source code

1,516 views

Published on

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,516
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
76
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Lampiran source code

  1. 1. LAMPIRAN -LAMPIRAN Lampiran 1 Sourcecode PasswordDim Passs As New ADODB.Connection ElseDim rsPass As New ADODB.Recordset MsgBox "Password yang anda masukkan tidak sesuai", vbCritical, "Salah"Private Sub cmdbatal_Click() txtuser.Text = ""Dim X txtuser.SetFocus X = MsgBox("Anda yakin inginmembatalkan Log-in ?.", _ txtpas.Text = "" vbYesNo + vbQuestion, "Yakin ingin End IfMembatalkan...?") End If If X = vbYes Then End Sub End Private Sub Command1_Click() End If Unload MeEnd Sub End SubPrivate Sub cmbbatal_Click() Private Sub Form_Load()Unload Me Set Passs = NothingEnd Sub Set rsPass = NothingPrivate Sub cmdOK_Click() Passs.Provider = "microsoft.jet.oledb.4.0"If txtpas = "" Then Passs.CursorLocation = adUseClient MsgBox "Anda belum memasukkanpassword!!!", vbCritical, "Salah!" Passs.Open App.Path & "/" & "db_pos.mdb", "admin", "" txtuser.Text = "" txtuser.Text = "" txtpas.Text = "" txtpas.Text = "" Else End Sub If txtuser.Text = Label3.Caption Then Private Sub txtuser_Change() Utama.Show Set rsPass = Nothing login.Hide rsPass.Open "login", Passs, txtuser.Text = "" adOpenDynamic, adLockOptimistic txtpas.Text = "" rsPass.Find "user=" + txtuser.Text + ""
  2. 2. If Not rsPass.EOF Then Label3.Caption = End SubrsPass!UserIf txtuser.Text = Label3.Caption Thentxtpas.SetFocus
  3. 3. Lampiran 2 Sourcecode Menu UtamaDim strTemp, LenTemp, n LenTemp = Len(strTemp)Dim strTmp, LenTmp, u Me.Caption = Left(strTemp, n) + "_"Private Sub benda_Click() n=n+1DataReport1.Show If n > LenTemp ThenEnd Sub n=1Private Sub BPM_Click() End IfPOSS.Show LenTmp = Len(strTmp)Utama.Hide Dim label As StringEnd Sub LenTmp = Len(strTmp)Private Sub Ganti_Click() Label1.Caption = Left(strTmp, u) + "_"gantip.Show u=u+1Utama.Hide If u > LenTmp ThenEnd Sub u=1Private Sub Form_Load() End IfstrTemp = Me.Caption End Sub n=1 Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)strTmp = Label1.Caption On Error Resume Next u=1 Select Case Button.IndexEnd Sub Case 2Private Sub Prog_Click() POSS.Showtentang.Show Utama.HideUtama.Hide Case 4End Sub DataReport1.ShowPrivate Sub Timer1_Timer() Utama.HideLenTemp = Len(strTemp) Case 6 Dim Form As String
  4. 4. gantip.Show X = MsgBox("Apakah anda ingin keluar dari aplikasi ini?", _ Utama.Hide vbYesNo + vbQuestion, "Yakin andaCase 8 ingin Keluar?") Help.Show If X = vbYes Then Utama.Hide EndCase 10 End If Close End Select Dim X End Sub
  5. 5. Lampiran 3 Source code POSSDim strTemp, LenTemp, n Private Sub hubung()Dim strTmp, LenTmp, u rspos!No = txtnop.TextDim POS As New ADODB.Connection rspos!Perangko = txtperangko.TextDim rspos As New ADODB.Recordset rspos!Harga = cmbhrgperangko.TextDim List As ListItem rspos!Dipenuhi = txtdipenuhi1.TextPrivate Sub Tampil() rspos!BSU = txtkalper1.TextDo While Not rspos.EOF rspos!tanggal = tanggal.ValueSet List = tampilkopur.ListItems.Add(, , rspos!Nopen = Txtnopenp.Textrspos.Fields!No) End SubList.SubItems(1) = rspos!Perangko Private Sub Ktemu()List.SubItems(2) = rspos!Harga txtnop.Text = rspos!NoList.SubItems(3) = rspos!Dipenuhi txtperangko.Text = rspos!PerangkoList.SubItems(4) = rspos!BSU cmbhrgperangko.Text = rspos!HargaList.SubItems(5) = rspos!tanggal txtdipenuhi1.Text = rspos!DipenuhiList.SubItems(6) = rspos!Nopen txtkalper1.Text = rspos!BSUrspos.MoveNext tanggal.Value = rspos!tanggalLoop Txtnopenp.Text = rspos!NopenEnd Sub End SubPrivate Sub Reset() Private Sub cmdbatalkon_Click()txtnop.Text = "" Set rspos = Nothingtxtperangko.Text = "" Resetkcmbhrgperangko.Text = "" txtcari.Text = ""txtdipenuhi1.Text = "" bersih.Enabled = Falsetxtkalper1.Text = "" cmdsimpankon.Caption = "&Simpan"tanggal.Value = "" End SubTxtnopenp.Text = "" Private Sub cmdBatalp_Click(Index AsEnd Sub Integer)
  6. 6. Set rspos = Nothing "Kemudian click hapus", vbInformation, "Salah"Reset Elsetxtcari.Text = "" rspos.Delete adAffectCurrentbersih.Enabled = False Resetnocmdsimpanp.Caption = "&Simpan" Set rspos = NothingEnd Sub rspos.Open "KoNopen", POS,Private Sub cmdbersihk_Click(Index As adOpenDynamic, adLockOptimisticInteger) TampilNopen.ListItems.ClearIf txtnok.Text = "" Then tampilnoMsgBox "Tidak ada data yang akandihapus" _ End If+ vbLf + "Click pada data yang ada di End Subdaftar" + vbLf + _ Private Sub cmdbersihp_Click(Index As"Kemudian click hapus", vbInformation, Integer)"Salah" If txtnop.Text = "" ThenElse MsgBox "Tidak ada data yang akanrspos.Delete adAffectCurrent dihapus" _Reset + vbLf + "Click pada data yang ada di daftar" + vbLf + _Set rspos = Nothing "Kemudian click hapus", vbInformation,rspos.Open "Tambahan", POS, "Salah"adOpenDynamic, adLockOptimistic Elsetampilkonsinyasi.ListItems.Clear rspos.Delete adAffectCurrentTampilk ResetEnd If Set rspos = NothingEnd Sub rspos.Open "kopur", POS,Private Sub cmdbersihn_Click() adOpenDynamic, adLockOptimisticIf txtkode.Text = "" Then tampilkopur.ListItems.ClearMsgBox "Tidak ada data yang akan Tampildihapus" _ End If+ vbLf + "Click pada data yang ada didaftar" + vbLf + _ End Sub
  7. 7. Private Sub cmdKeluark_Click(Index As " ulangi pemasukkan data",Integer) vbExclamation, "Peringatan"Unload Me Combok.Text = ""End Sub Combok.SetFocus ElsePrivate Sub cmdkeluar_Click() Set rspos = NothingUtama.Show rspos.Open "materai", POS, adOpenDynami, adLockOptimisticPOSS.Hide rspos.AddNewEnd Sub hubungm rspos.UpdatePrivate Sub cmdkeluarkon_Click(IndexAs Integer) End IfUtama.Show If cmdsimpanm.Caption = "&Edit" ThenPOSS.Hide hubungmEnd Sub rspos.Update cmdsimpanm.Caption = "&Simpan"Private Sub cmdKeluarp_Click(Index As End IfInteger) Set rspos = NothingUtama.Show rspos.Open "materai", POS,POSS.Hide adOpenDynamic, adLockOptimisticEnd Sub tampilmmaterai.ListItems.ClearPrivate Sub cmdsimpanm_Click() TampilmIf cmdsimpanm.Caption = "&Simpan" ResetmThen txtnom.SetFocusSet rspos = Nothing End Subrspos.Open "materai", POS,adOpenDynamic, adLockOptimistic Private Sub tampilno()rspos.Find "Nomor like " + txtnom.Text Do While Not rspos.EOF+ "" Set List = TampilNopen.ListItems.Add(, ,If Not rspos.EOF Then rspos.Fields!KodeNopen)MsgBox "No yang anda masukkan sudah List.SubItems(1) = rspos!Nopenterdapat dalam daftar" + vbLf + _ rspos.MoveNext
  8. 8. Loop rspos.Find "KodeNopen=" + txtkode.Text + ""End Sub Ktemuno cmdsimpann.Caption = "&Edit"Private Sub Resetno() cmdbersihn.Enabled = Truetxtkode.Text = "" End SubTxtnopen.Text = "" Private Sub cmdkeluarn_Click()End Sub Utama.ShowPrivate Sub hubungno() POSS.Hiderspos!KodeNopen = txtkode.Text End Subrspos!Nopen = Txtnopen.Text Private Sub cmdsimpann_Click()End Sub If cmdsimpann.Caption = "&Simpan"Private Sub Ktemuno() Thentxtkode.Text = rspos!KodeNopen Set rspos = NothingTxtnopen.Text = rspos!Nopen rspos.Open "KoNopen", POS, adOpenDynamic, adLockOptimisticEnd Sub rspos.Find "Kodenopen like " + txtkode.Text + ""Private Sub cmdbataln_Click() If Not rspos.EOF ThenSet rspos = Nothing MsgBox "No yang anda masukkan sudahResetno terdapat dalam daftar" + vbLf + _txtcari.Text = "" " ulangi pemasukkan data", vbExclamation, "Peringatan"bersih.Enabled = False txtkode.SetFocuscmdsimpann.Caption = "&Simpan" ElseEnd Sub Set rspos = NothingPrivate Subtampilnopen_BeforeLabelEdit(Cancel As rspos.Open "KoNopen", POS,Integer) adOpenDynami, adLockOptimisticSet rspos = Nothing rspos.AddNewrspos.Open "KoNopen", POS, hubungnoadOpenDynamic, adLockOptimistic rspos.Updatetxtkode.Text = End IfTampilNopen.SelectedItem
  9. 9. If cmdsimpann.Caption = "&Edit" Then End Subhubungno Private Sub Text3_Change()rspos.Update txtkalkon.Text = Val(Text3.Text) + Val(txtbsukon.Text)cmdsimpann.Caption = "&Simpan" End SubEnd IfSet rspos = Nothing Private Sub Timer1_Timer()rspos.Open "KoNopen", POS,adOpenDynamic, adLockOptimistic LenTemp = Len(strTemp)TampilNopen.ListItems.Clear Dim Form As Stringtampilno LenTemp = Len(strTemp)Resetno Me.Caption = Left(strTemp, n) + "_"End Sub n=n+1Private Sub If n > LenTemp Thentampilkonsinyasi_BeforeLabelEdit(Cancel As Integer) n=1Set rspos = Nothing End Ifrspos.Open "tambahan", POS, LenTmp = Len(strTmp)adOpenDynamic, adLockOptimistic Dim label As Stringtxtnok.Text =tampilkonsinyasi.SelectedItem LenTmp = Len(strTmp)rspos.Find "Nok=" + txtnok.Text + "" Label3.Caption = Left(strTmp, u) + "_"Ktemuk u=u+1cmdsimpankon.Caption = "&Edit" If u > LenTmp Thencmdbersihk.Enabled = True u=1End Sub End IfPrivate Sub Text1_Change() End Subtxtkalper1.Text = Val(Text1.Text) + Private Sub txtdipenuhim_Change()Val(txtbsu1.Text) Text2.Text = Val(cmbhrgmaterai.Text) *End Sub Val(txtdipenuhim.Text)Private Sub Text2_Change() txtbsum.Text = Val(cmbhrgmaterai.Text) * Val(txtdipenuhim.Text)txtmat.Text = Val(Text2.Text) +Val(txtbsum.Text) End Sub
  10. 10. Private Sub cmdsimpanp_Click() ResetIf cmdsimpanp.Caption = "&Simpan" txtnop.SetFocusThen End SubSet rspos = Nothing Private Sub Form_Load()rspos.Open "kopur", POS,adOpenDynamic, adLockOptimistic strTemp = Me.Captionrspos.Find "No like " + txtnop.Text + "" n=1If Not rspos.EOF Then strTmp = Label3.CaptionMsgBox "No yang anda masukkan sudah u=1terdapat dalam daftar" + vbLf + _ Set POS = Nothing" ulangi pemasukkan data",vbExclamation, "Peringatan" Set rspos = NothingCombok.Text = "" POS.Provider = "microsoft.jet.oledb.4.0"Combok.SetFocus POS.CursorLocation = adUseClientElse POS.Open App.Path & "/" & "db_pos.mdb", "admin", ""Set rspos = Nothing rspos.Open "kopur", POS,rspos.Open "kopur", POS, adOpenDynamic, adLockOptimisticadOpenDynami, adLockOptimistic tampilkopur.ListItems.Clearrspos.AddNew Tampilhubung Set POS = Nothingrspos.Update Set rspos = NothingEnd If POS.Provider = "microsoft.jet.oledb.4.0"If cmdsimpanp.Caption = "&Edit" Then POS.CursorLocation = adUseClienthubung POS.Open App.Path & "/" &rspos.Update "db_pos.mdb", "admin", ""cmdsimpanp.Caption = "&Simpan" rspos.Open "materai", POS, adOpenDynamic, adLockOptimisticEnd If tampilmmaterai.ListItems.ClearSet rspos = Nothing Tampilmrspos.Open "kopur", POS,adOpenDynamic, adLockOptimistic Set POS = Nothingtampilkopur.ListItems.Clear Set rspos = NothingTampil POS.Provider = "microsoft.jet.oledb.4.0"
  11. 11. POS.CursorLocation = adUseClient cmbthn.AddItem 2010POS.Open App.Path & "/" & cmbthn.AddItem 2011"db_pos.mdb", "admin", "" cmbhrgmaterai.AddItem "3000"rspos.Open "tambahan", POS,adOpenDynamic, adLockOptimistic cmbhrgmaterai.AddItem "6000"tampilkonsinyasi.ListItems.Clear cmbkon.AddItem "Kartu Perdana Share"Tampilk cmbkon.AddItem "Sampul"Set POS = Nothing cmbkon.AddItem "Kartu Takaf"Set rspos = Nothing End SubPOS.Provider = "microsoft.jet.oledb.4.0" Private Sub Form_Unload(Cancel As Integer)POS.CursorLocation = adUseClient DoPOS.Open App.Path & "/" &"db_pos.mdb", "admin", "" Me.Top = Me.Top + 300rspos.Open "KoNopen", POS, Me.Move Me.Left, Me.TopadOpenDynamic, adLockOptimistic DoEventsTampilNopen.ListItems.Clear Loop Until Me.Top > Screen.Height -tampilno 500cmbhrgperangko.AddItem 1000 End Subcmbhrgperangko.AddItem 1500 Private Sub tampilkopur_BeforeLabelEdit(Cancel Ascmbhrgperangko.AddItem 2000 Integer)cmbhrgperangko.AddItem 2500 Set rspos = Nothingcmbhrgperangko.AddItem 3000 rspos.Open "kopur", POS, adOpenDynamic, adLockOptimisticcmbhrgperangko.AddItem 3500 txtnop.Text = tampilkopur.SelectedItemcmbhrgperangko.AddItem 4000 rspos.Find "No=" + txtnop.Text + ""cmbhrgperangko.AddItem 4500 Ktemucmbhrgperangko.AddItem 5000 cmdsimpanp.Caption = "&Edit"cmbthn.AddItem 2005 bersih.Enabled = Truecmbthn.AddItem 2006 End Subcmbthn.AddItem 2007 Private Sub Tutup_Click(Index Ascmbthn.AddItem 2008 Integer)cmbthn.AddItem 2009 Unload POS
  12. 12. End Sub bersih.Enabled = TruePrivate Sub txtcari_Change() End SubSet rspos = Nothing Private Sub txtdipenkon_Change()If txtcari.Text = "" Then Text3.Text = Val(txthrgkon.Text) * Val(txtdipenkon.Text)rspos.Open "kopur", POS,adOpenDynamic, adLockOptimistic txtbsukon.Text = Val(txthrgkon.Text) * Val(txtdipenkon.Text)Else End Subrspos.Open "kopur", POS,adOpenDynamic, adLockOptimistic Private Sub txtdipenuhi1_Change()rspos.Filter = "Tahun like *" + Text1.Text = Val(cmbhrgperangko.Text)txtcari.Text + "*" * Val(txtdipenuhi1.Text)End If txtbsu1.Text = Val(cmbhrgperangko.Text) *tampilkopur.ListItems.Clear Val(txtdipenuhi1.Text)Tampil End SubEnd Sub Private Sub Tampilm()Private Sub txtdipenm_Change() Do While Not rspos.EOFtxtkalper1.Text = Set List =Val(cmbhrgperangko.Text) * tampilmmaterai.ListItems.Add(, ,Val(txtdipenuhi1.Text) rspos.Fields!Nomor)txtbsu1.Text = List.SubItems(1) = rspos!Materai_TahunVal(cmbhrgperangko.Text) *Val(txtdipenuhi1.Text) List.SubItems(2) = rspos!HargamEnd Sub List.SubItems(3) = rspos!DipenuhimPrivate Sub List.SubItems(4) = rspos!Bsumtampilmmaterai_BeforeLabelEdit(CancelAs Integer) List.SubItems(5) = rspos!tanggalmSet rspos = Nothing List.SubItems(6) = rspos!Nopenmrspos.Open "materai", POS, rspos.MoveNextadOpenDynamic, adLockOptimistic Looptxtnom.Text =tampilmmaterai.SelectedItem End Subrspos.Find "Nomor=" + txtnom.Text + "" Private Sub Resetm()Ktemum txtnom.Text = ""cmdsimpanm.Caption = "&Edit" cmbthn.Text = ""
  13. 13. cmbhrgmaterai.Text = "" bersih.Enabled = Falsetxtdipenuhim.Text = "" cmdsimpanm.Caption = "&Simpan"txtbsum.Text = "" End Subtanggalm.Value = "" Private Sub cmdbersihm_Click()Txtnopenm.Text = "" If txtnom.Text = "" ThenEnd Sub MsgBox "Tidak ada data yang akan dihapus" _Private Sub Ktemum() + vbLf + "Click pada data yang ada ditxtnom.Text = rspos!Nomor daftar" + vbLf + _cmbthn.Text = rspos!Materai_Tahun "Kemudian click hapus", vbInformation, "Salah"cmbhrgmaterai.Text = rspos!Hargam Elsetxtdipenuhim.Text = rspos!Dipenuhim rspos.Delete adAffectCurrenttxtbsum.Text = rspos!Bsum Resetmtanggalm.Value = rspos!tanggalm Set rspos = NothingTxtnopenm.Text = rspos!Nopenm rspos.Open "materai", POS,End Sub adOpenDynamic, adLockOptimisticPrivate Sub hubungm() tampilmmaterai.ListItems.Clearrspos!Nomor = txtnom.Text Tampilmrspos!Materai_Tahun = cmbthn.Text End Ifrspos!Hargam = cmbhrgmaterai.Text End Subrspos!Dipenuhim = txtdipenuhim.Text Private Sub cmdkeluarm_Click()rspos!Bsum = txtbsum.Text Utama.Showrspos!tanggalm = tanggalm.Value BPM.Hiderspos!Nopenm = Txtnopenm.Text End SubEnd Sub Private Sub Tampilk()Private Sub cmdbatalm_Click(Index As Do While Not rspos.EOFInteger) Set List =Set rspos = Nothing tampilkonsinyasi.ListItems.Add(, ,Resetm rspos.Fields!Nok)txtcari.Text = "" List.SubItems(1) = rspos!Konsinyasik List.SubItems(2) = rspos!Hargak
  14. 14. List.SubItems(3) = rspos!Dipenuhik txtnok.Text = rspos!NokList.SubItems(4) = rspos!Bsuk cmbkon.Text = rspos!KonsinyasikList.SubItems(5) = rspos!BSUTOTAL txthrgkon.Text = rspos!HargakList.SubItems(6) = rspos!tanggalk txtdipenkon.Text = rspos!DipenuhikList.SubItems(7) = rspos!Nopenk txtbsukon.Text = rspos!Bsukrspos.MoveNext txtkaltotal1.Text = rspos!BSUTOTALLoop tgl3.Value = rspos!tanggalkEnd Sub Txtnopenkon.Text = rspos!NopenkPrivate Sub Resetk() End Subtxtnok.Text = "" Private Sub cmdbatalk_Click(Index As Integer)cmbkon.Text = "" Set rspos = Nothingtxthrgkon.Text = "" Resetktxtdipenkon.Text = "" txtcari.Text = ""txtbsukon.Text = "" bersih.Enabled = Falsetxtkaltotal1.Text = "" cmdsimpankon.Caption = "&Simpan"tgl3.Value = "" End SubTxtnopenkon.Text = "" Private Sub cmdsimpankon_Click()End Sub If cmdsimpankon.Caption = "&Simpan"Private Sub hubungk() Thenrspos!Nok = txtnok.Text Set rspos = Nothingrspos!Konsinyasik = cmbkon.Text rspos.Open "tambahan", POS, adOpenDynamic, adLockOptimisticrspos!Hargak = txthrgkon.Text rspos.Find "Nok like " + txtnok.Text +rspos!Dipenuhik = txtdipenkon.Text ""rspos!Bsuk = txtbsukon.Text If Not rspos.EOF Thenrspos!BSUTOTAL = txtkaltotal1.Text MsgBox "No yang anda masukkan sudahrspos!tanggalk = tgl3.Value terdapat dalam daftar" + vbLf + _rspos!Nopenk = Txtnopenkon.Text " ulangi pemasukkan data", vbExclamation, "Peringatan"End Sub Combok.Text = ""Private Sub Ktemuk() Combok.SetFocus
  15. 15. Else Private Sub txtkode_KeyPress(KeyAscii As Integer)Set rspos = Nothing KeyAscii = Asc(UCase(Chr(KeyAscii)))rspos.Open "tambahan", POS,adOpenDynami, adLockOptimistic End Subrspos.AddNewhubungk Private Sub Txtkodenop_Change()rspos.Update Set rspos = NothingEnd If rspos.Open "KoNopen", POS, adOpenDynamic, adLockOptimisticIf cmdsimpankon.Caption = "&Edit"Then rspos.Find "KodeNopen=" + Txtkodenop.Text + ""hubungk If Not rspos.EOF Then Txtnopenp.Text =rspos.Update rspos!Nopencmdsimpankon.Caption = "&Simpan" If Txtkodenop.Text = "" ThenEnd If Txtnopenp.Text = ""Set rspos = Nothing End Ifrspos.Open "tambahan", POS, End SubadOpenDynamic, adLockOptimistic Private Sub txtmat_Change()tampilkonsinyasi.ListItems.Clear txtkaltotal1.Text = Val(txtkalper1.Text) +Tampilk Val(txtmat.Text) + Val(txtkalkon.Text)Resetk End Subtxtnok.SetFocus Private Sub txtnok1_Change()End Sub Set rspos = NothingPrivate Sub txtkalkon_Change() rspos.Open "KoNopen", POS, adOpenDynamic, adLockOptimistictxtkaltotal1.Text = Val(txtkalper1.Text) +Val(txtmat.Text) + Val(txtkalkon.Text) rspos.Find "KodeNopen=" + txtnok1.Text + ""End Sub If Not rspos.EOF Then Txtnopenkon.Text = rspos!NopenPrivate Sub txtkalper1_Change() If txtnok1.Text = "" Thentxtkaltotal1.Text = Val(txtkalper1.Text) + Txtnopenkon.Text = ""Val(txtmat.Text) + Val(txtkalkon.Text) End IfEnd Sub
  16. 16. End Sub Txtnopenm.Text = ""Private Sub txtnom1_Change() End IfSet rspos = Nothing End Subrspos.Open "KoNopen", POS, Private SubadOpenDynamic, adLockOptimistic Txtnopen_KeyPress(KeyAscii As Integer)rspos.Find "KodeNopen=" +txtnom1.Text + "" KeyAscii = Asc(UCase(Chr(KeyAscii)))If Not rspos.EOF Then Txtnopenm.Text End Sub= rspos!NopenIf txtnom1.Text = "" Then
  17. 17. Lampiran 4 Sourcecode Ganti PassowordDim Ganti As New ADODB.Connection txtbru2.Text = ""Dim rsGanti As New ADODB.Recordset txtbru1.SetFocusPrivate Sub cmdbatal_Click() End IfUtama.Show End Ifgantip.Hide txtpl.Text = ""End Sub txtbru1.Text = ""Private Sub cmdOK_Click() txtbru2.Text = ""If Label4.Caption = "" Then Label4.Caption = ""MsgBox "Anda tidak berhak untuk End Submengganti password", vbCritical,"Informasi " Private Sub Command2_Click()txtpl.Text = "" Menu.Showtxtbru1.Text = "" GantiF.Hidetxtbru2.Text = "" End Subtxtpl.SetFocus Private Sub Commandbatal_Click()Else Utama.ShowIf txtbru1.Text = txtbru2.Text Then gantip.HidersGanti!Password = txtbru1.Text GantiF.HidersGanti.Update End SubUtama.Show Private Sub Commandok_Click()MsgBox "Password telah diganti", If Label9.Caption = "" ThenvbInformation, "Information" MsgBox "Anda tidak berhak untukElse mengganti User Name", vbCritical, "Informasi "MsgBox "Password yang anda masukkantidak sesuai" + vbLf + _ txtus.Text = """Masukkan password baru sekali lagi", txtus1.Text = ""vbInformation, "Konfirmasi" txtus2.Text = ""txtbru1.Text = "" txtus.SetFocus
  18. 18. Else Ganti.Open App.Path & "/" & "db_pos.mdb", "admin", ""If txtus1.Text = txtus2.Text Then Label4.Caption = ""rsGanti!User = txtus1.Text Label9.Caption = ""rsGanti.Update Frame1.Visible = FalseUtama.Show Frame2.Visible = Falsegantip.Hide Label5.Visible = FalseMsgBox "User Name telah diganti",vbInformation, "Information" Label11.Visible = FalseElse End SubMsgBox "User Name yang anda Private Sub pas_Click(Index As Integer)masukkan tidak sesuai" + vbLf + _ Frame1.Visible = True"Masukkan User Name baru sekali lagi",vbInformation, "Konfirmasi" Frame2.Visible = Falsetxtus1.Text = "" Label11.Visible = Truetxtus2.Text = "" Label5.Visible = Falsetxtus1.SetFocus End SubEnd If Private Sub txtbru1_KeyPress(KeyAscii As Integer)End If KeyAscii = Asc(UCase(Chr(KeyAscii)))txtus.Text = "" End Subtxtus1.Text = "" Private Sub txtbru2_KeyPress(KeyAsciitxtus2.Text = "" As Integer)Label9.Caption = "" KeyAscii = Asc(UCase(Chr(KeyAscii)))End Sub End SubPrivate Sub Form_KeyPress(KeyAscii As Private Sub txtpl_Change()Integer) Set rsGanti = NothingKeyAscii = Asc(UCase(Chr(KeyAscii))) rsGanti.Open "Login", Ganti,End Sub adOpenDynamic, adLockOptimisticPrivate Sub Form_Load() rsGanti.Find "Password=" + txtpl.Text + ""Ganti.Provider = "microsoft.jet.oledb.4.0" If Not rsGanti.EOF Then Label4.CaptionGanti.CursorLocation = adUseClient = rsGanti!Password End Sub
  19. 19. Private Sub txtus_Change()Set rsGanti = NothingrsGanti.Open "Login", Ganti,adOpenDynamic, adLockOptimisticrsGanti.Find "User=" + txtus.Text + ""If Not rsGanti.EOF Then Label9.Caption= rsGanti!UserEnd SubPrivate Sub txtus_KeyPress(KeyAscii AsInteger)KeyAscii = Asc(UCase(Chr(KeyAscii)))End SubPrivate Sub txtus1_KeyPress(KeyAsciiAs Integer)KeyAscii = Asc(UCase(Chr(KeyAscii)))End SubPrivate Sub txtus2_KeyPress(KeyAsciiAs Integer)KeyAscii = Asc(UCase(Chr(KeyAscii)))End SubPrivate Sub User_Click(Index As Integer)Frame1.Visible = FalseFrame2.Visible = TrueLabel11.Visible = FalseLabel5.Visible = TrueEnd Sub

×