Download source code vb6, source code delphi7, tutorial vb, tutorial delphi, tutorial php

Jawaban Tugas PraUAS VB2

Share on :
Ini neh jawaban dari soal latihan vb2 kasus PERPUSTAKAAN, dari pada copast ga jelas,mending di cek ajah neh langsung di pisah per event aja biar jelas.buat penampakannya dilihat dulu deh

Bagi yang belum tau bentuk dari form peminjamannya.
Berikut Listing per EVENT nya :

  1. Private Sub ccancel_Click()  
  2. Call bersih  
  3. np.Enabled = False  
  4. noa.Enabled = False  
  5. naa.Enabled = False  
  6. kb.Enabled = False  
  7. jd.Enabled = False  
  8. tglbatas.Enabled = False  
  9. jp.Enabled = False  
  10. End Sub  
  11. Sub bersih()  
  12. np.Text = ""  
  13. noa.Text = ""  
  14. naa.Text = ""  
  15. kb.Text = "pilih"  
  16. jd.Text = ""  
  17. tglbatas.Text = ""  
  18. jp.Text = ""  
  19. End Sub  
  20.   
  21. Private Sub cclose_Click()  
  22. a = MsgBox("Anda ingin keluar???", vbQuestion + vbOKCancel, "Konfirmasi")  
  23. If a = vbOK Then End  
  24. End Sub  
  25.   
  26. Private Sub cinput_Click()  
  27. simpankedetailpinjam = "insert into detail_pinjam values('" & np.Text & "','" & kb.Text & "','" & jd.Text & "','" & tglbatas.Text & "')"  
  28. Set d = a.Execute(simpankedetailpinjam, , adCmdText)  
  29. naa.Text = ""  
  30. kb.Text = "pilih"  
  31. jd.Text = ""  
  32. tglbatas.Text = ""  
  33. jp.Text = ""  
  34. End Sub  
  35.   
  36. Private Sub cnew_Click()  
  37. nopinjamotomatis = "select *from pinjam order by nopinjam desc"  
  38. Set c = a.Execute(nopinjamotomatis, , adCmdText)  
  39.   
  40. If c.BOF And c.EOF Then  
  41. np.Text = "P" + Format(Date"yy") & Format(Date"mm") & "001"  
  42. Else  
  43. c.MoveFirst  
  44. np.Text = "P" + Format(Date"yy") & Format(Date"mm") & Right(Str(Val(Right(c!nopinjam, 3)) + 1001), 3)  
  45. End If  
  46. noa.SetFocus  
  47. End Sub  
  48.   
  49. Private Sub csave_Click()  
  50. simpankedetailpinjam = "insert into detail_pinjam values('" & np.Text & "','" & kb.Text & "','" & jd.Text & "','" & tglbatas.Text & "')"  
  51. Set d = a.Execute(simpankedetailpinjam, , adCmdText)  
  52.   
  53. simpankepinjam = "insert into pinjam values('" & np.Text & "','" & lbltanggal.Caption & "','" & jp.Text & "','" & noa.Text & "')"  
  54. Set c = a.Execute(simpankepinjam, , adCmdText)  
  55. Set Grid1.DataSource = c  
  56. End Sub  
  57.   
  58. Private Sub Form_Activate()  
  59. Call koneksi  
  60. tampilgrid = "select *from pinjam"  
  61. 'Set c = a.Execute(tampilgrid, , adCmdText)  
  62. 'Set Grid1.DataSource = c  
  63. Call bersih  
  64. csave.Enabled = False  
  65. cinput.Enabled = False  
  66. ccancel.Enabled = False  
  67. lbltanggal.Caption = Format(Date"yy-mm-dd")  
  68. End Sub  
  69.   
  70.   
  71. Private Sub kb_Click()  
  72. If kb.Text = "001" Then  
  73. jd.Text = "pudarnya pesona cleopatra"  
  74. ElseIf kb.Text = "002" Then  
  75. jd.Text = "berteduh di taman hati"  
  76. Else  
  77. jd.Text = "sarah rasmul bayan tarbiyah"  
  78. End If  
  79. cinput.Enabled = True  
  80. csave.Enabled = True  
  81. ccancel.Enabled = True  
  82. End Sub  
  83.   
  84. Private Sub noa_KeyPress(KeyAscii As Integer)  
  85. If KeyAscii = 13 Then  
  86. carinamaanggota = "select *from anggota where no_agt='" & noa.Text & "'"  
  87. Set b = a.Execute(carinamaanggota, , adCmdText)  
  88.   
  89. If b.BOF And b.EOF Then  
  90. MsgBox "Kode Anggota Tidak ada ", , "Info"  
  91. Else  
  92. naa.Text = b!nama  
  93. End If  
  94. End If  
  95. End Sub  
Nah buat source codenya di download ajah deh. . .
Download disini :
Download
Close

Klik Like/share jika anda menyukai tulisan Share

0 komentar on Jawaban Tugas PraUAS VB2 :

Post a Comment and Don't Spam!

Terimakasih Sudah Berkomentar di artikel ini