FORM MENU Private Sub Command1_Click() frmpasien.show Private Sub Command2_Click() frmpembayaran.show Private Sub Command3_Click() frmberobat.show Private Sub Command4_Click() frmobat.show Private Sub Command5_Click() frmlaporan.show Private Sub Command6_Click() End Private Sub Label3_Click() End Private Sub Label4_Click() MsgBox "Program ini dibuat oleh Diana" & Chr(13) & "Untuk mengikuti Sidang Sarjana", vbinformation, "Pesan" FORM DATA PASIEN Private Enum Aksi flnone = 0 fladd = 1 fledit = 2 End Enum Dim Flag As Aksi Private Sub kunci(x) Text1.Locked = x Text2.Locked = x Text3.Locked = x Text4.Locked = x Text5.Locked = x Text6.Locked = x Private Sub AturTombol(add, edit, delete, update, cancel) cmdadd.enabled = add cmdedit.enabled = edit cmddelete.enabled = delete cmdupdate.enabled = update
cmdcancel.enabled = cancel Private Sub cmdadd_click() Flag = fladd Data1.Recordset.MoveLast a = Data1.Recordset.Fields(0).Value b = Format$(Val(a) + 1, "000") Data1.Recordset.AddNew Text1.Text = b Call kunci(false) Call AturTombol(False, False, False, True, True) Text2.SetFocus Private Sub cmddelete_click() On Error GoTo ErrCmdDelete_Click x = MsgBox("Yakin akan dihapus...", vbyesno + vbquestion, "Konfirmasi...") If x = vbyes Then Data1.Recordset.delete Data1.Recordset.MoveNext If Data1.Recordset.EOF Then Data1.Recordset.MoveLast ErrCmdDelete_Click: Select Case Err.Number Case 3021 MsgBox "Data telah kosong", vbokonly + vbinformation, "Peringatan..." End Select Private Sub cmdedit_click() Flag = fledit Data1.Recordset.edit Call kunci(false) Call AturTombol(False, False, False, True, True) Private Sub cmdexit_click() frmmenu.show Private Sub cmdupdate_click() On Error GoTo ErrUpdate_click If Text1.Text = "" Then MsgBox "No Pasien idak boleh kosong", vbcritical, "Peringatan" If Text2.Text = "" Then MsgBox "Nama Pasien tidak boleh kosong", vbcritical, "Peringatan" If Text3.Text = "" Then MsgBox "Jenis Kelamin tidak boleh kosong", vbcritical, "Peringatan" If Text4.Text = "" Then MsgBox "Umur tidak boleh kosong", vbcritical, "Peringatan"
If Text5.Text = "" Then MsgBox "Golongan Darah tidak boleh kosong", vbcritical, "Peringatan" If Text6.Text = "" Then MsgBox "Alamat tidak boleh kosong", vbcritical, "Peringatan" Data1.Recordset.update MsgBox "Data Pasien tersimpan", vbinformation, "Informasi" Flag = flnone Call kunci(true) Call AturTombol(True, True, True, False, False) Data1.Recordset.Bookmark = Data1.Recordset.LastModified ErrUpdate_click: Select Case Err.Number Case 3022 MsgBox "Telah terjadi duplikasi pada No Pasien", vbokonly + vbinformation, "Peringatan" Case Else MsgBox Err.Number & vbcrlf & Err.Description End Select Private Sub cmdcancel_click() Data1.Recordset.CancelUpdate Call kunci(true) Flag = flnone Call AturTombol(True, True, True, False, False) Private Sub Command1_Click() On Error GoTo salah frmcetak.show frmcetak.font = "Courier New" frmcetak.fontsize = "12" mgrs = String(80, "-") Tab(29); "BALAI PENGOBATAN" Tab(28); "PAMULANG PERMAI II" Tab(25); "BLOK C 29 No.17 Telp 7493743" mgrs Tab(31); "KARTU BEROBAT" mgrs Tab(10); "No Pasien : " & Text1.Text; Tab(10); "Nama Pasien : " & Text2.Text; Tab(10); "Jenis Kelamin : " & Text3.Text; Tab(10); "Umur : " & Text4.Text & " Tahun"; Tab(10); "Golongan Darah : " & Text5.Text; Tab(10); "Alamat : " & Text6.Text mgrs salah: Select Case Err.Number
Case 482 MsgBox "Printer Error...", vbcritical, "Peringatan..." Unload frmcetak frmberobat.show Case Else MsgBox Err.Number & vbcrlf & Err.Description End Select Private Sub Form_Load() Data1.DatabaseName = App.Path & "\diana1.mdb" Data1.RecordSource = "pasien" Call AturTombol(True, True, True, False, False) Call kunci(true) Private Sub Text1_KeyPress(KeyAscii As Integer) If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbkeyback Or KeyAscii = 13) Then KeyAscii = 0 Text2.SetFocus Private Sub Text2_KeyPress(KeyAscii As Integer) Text3.SetFocus Private Sub Text3_KeyPress(KeyAscii As Integer) Text4.SetFocus Private Sub Text4_KeyPress(KeyAscii As Integer) Text5.SetFocus Private Sub Text5_KeyPress(KeyAscii As Integer) Text6.SetFocus Private Sub Text6_KeyPress(KeyAscii As Integer) cmdupdate.setfocus
FORM DATA OBAT Private Enum Aksi flnone = 0 fladd = 1 fledit = 2 End Enum Dim Flag As Aksi Private Sub kunci(x) Text1.Locked = x Text2.Locked = x Text3.Locked = x Text4.Locked = x Text5.Locked = x Private Sub AturTombol(add, edit, delete, update, cancel) cmdadd.enabled = add cmdedit.enabled = edit cmddelete.enabled = delete cmdupdate.enabled = update cmdcancel.enabled = cancel Private Sub cmdadd_click() Flag = fladd Data1.Recordset.MoveLast a = Data1.Recordset.Fields(0).Value b = Format$(Val(a) + 1, "000") Data1.Recordset.AddNew Text1.Text = b Call kunci(false) Call AturTombol(False, False, False, True, True) Text2.SetFocus Private Sub cmddelete_click() On Error GoTo ErrCmdDelete_Click x = MsgBox("Yakin akan dihapus...", vbyesno + vbquestion, "Konfirmasi...") If x = vbyes Then Data1.Recordset.delete Data1.Recordset.MoveNext If Data1.Recordset.EOF Then Data1.Recordset.MoveLast ErrCmdDelete_Click: Select Case Err.Number Case 3021 MsgBox "Data telah kosong", vbokonly + vbinformation, "Peringatan..." End Select Private Sub cmdedit_click() Flag = fledit Data1.Recordset.edit Call kunci(false) Call AturTombol(False, False, False, True, True)
Private Sub cmdexit_click() frmmenu.show Private Sub cmdupdate_click() On Error GoTo ErrUpdate_click If Text1.Text = "" Then MsgBox "Kode Obat idak boleh kosong", vbcritical, "Peringatan" If Text2.Text = "" Then MsgBox "Nama Obat tidak boleh kosong", vbcritical, "Peringatan" If Text3.Text = "" Then MsgBox "Persediaan tidak boleh kosong", vbcritical, "Peringatan" If Text5.Text = "" Then MsgBox "harga Obat tidak boleh kosong", vbcritical, "Peringatan" Data1.Recordset.update MsgBox "Data Obat tersimpan", vbinformation, "Informasi" Flag = flnone Call kunci(true) Call AturTombol(True, True, True, False, False) Data1.Recordset.Bookmark = Data1.Recordset.LastModified ErrUpdate_click: Select Case Err.Number Case 3022 MsgBox "Telah terjadi duplikasi pada No Pasien", vbokonly + vbinformation, "Peringatan" Case Else MsgBox Err.Number & vbcrlf & Err.Description End Select Private Sub cmdcancel_click() Data1.Recordset.CancelUpdate Call kunci(true) Flag = flnone Call AturTombol(True, True, True, False, False) Private Sub Form_Load() Data1.DatabaseName = App.Path & "\diana1.mdb" Data1.RecordSource = "Data_Obat" Call AturTombol(True, True, True, False, False) Call kunci(true) Private Sub Text1_KeyPress(KeyAscii As Integer) If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbkeyback Or KeyAscii = 13) Then KeyAscii = 0 Text2.SetFocus
Private Sub Text2_KeyPress(KeyAscii As Integer) Text3.SetFocus Private Sub Text3_KeyPress(KeyAscii As Integer) Text4.Text = Text3.Text Text5.SetFocus Private Sub Text5_KeyPress(KeyAscii As Integer) cmdupdate.setfocus Private Sub Text6_KeyPress(KeyAscii As Integer) cmdupdate.setfocus FORM BEROBAT PASIEN Sub tombol(trans, add, update, cancel, ok) cmdtrans.enabled = trans cmdadd.enabled = add cmdupdate.enabled = update cmdcancel.enabled = cancel Command1.Enabled = ok Sub kunci(x) Private Sub cmdadd_click() Call tombol(0, 0, 0, 0, 0) Data1.Recordset.AddNew Combo2.SetFocus Private Sub cmdcancel_click() Data1.Recordset.CancelUpdate Call tombol(0, 1, 0, 0, 0) Private Sub cmdexit_click() frmmenu.show Private Sub cmdok_click() On Error GoTo salah Dbobat.Recordset.MoveFirst Do If Dbobat.Recordset.Fields("sisa_stok").Value < Val(Text12.Text) Then MsgBox "Transaksi Melebihi Stok", vbinformation, "Pesan" Text12.SetFocus
Dbobat.Recordset.MoveNext Loop Until Dbobat.Recordset.EOF If M.TextMatrix(1, 0) = "" Then M.TextMatrix(1, 0) = Combo1.Text M.TextMatrix(1, 1) = Text10.Text M.TextMatrix(1, 2) = Text7.Text M.TextMatrix(1, 3) = Text12.Text M.TextMatrix(1, 4) = Text13.Text M.TextMatrix(1, 5) = Text8.Text M.TextMatrix(1, 6) = Text9.Text Else M.AddItem Combo2.Text & vbtab & Text10.Text & vbtab & Text7.Text & vbtab & Text12.Text & vbtab & Text13.Text & vbtab & Text8.Text & vbtab & Text9.Text total = 0 harga = 0 For x = 1 To M.Rows - 1 total = total + Val(M.TextMatrix(x, 4)) Next x Label19.Caption = total Call tombol(0, 0, 1, 1, 0) cmdupdate.setfocus salah: Select Case Err.Number Case 3021: MsgBox "Duplicate", vbinformation, "Pesan" End Select Private Sub cmdtrans_click() Call tombol(0, 0, 0, 1, 0) Text1.SetFocus If Not (Dbberobat.Recordset.EOF And Dbberobat.Recordset.BOF) Then 'jika Dbberobat.Recordset.MoveLast a = Dbberobat.Recordset.Fields(0).Value Else a = 0 b = Format$(Val(a) + 1, "000") Text1.SetFocus Text1.Text = b Dbberobat.Recordset.AddNew Private Sub cmdupdate_click() tmp = Combo2.List(Combo2.ListIndex) Dbobat.Recordset.MoveFirst Do If Dbobat.Recordset.Fields("Kode_Obat").Value = tmp Then Dbobat.Recordset.edit Dbobat.Recordset.Fields("sisa_stok").Value = Dbobat.Recordset.Fields("sisa_stok").Value - Val(Text12.Text)
Dbobat.Recordset.Fields("stok").Value = Dbobat.Recordset.Fields("sisa_stok").Value Dbobat.Recordset.update Dbobat.Recordset.MoveNext Loop Until Dbobat.Recordset.EOF Dbobat.Refresh Data1.Recordset.Fields("kode_obat").Value = Combo2.Text Data1.Recordset.Fields("nama_obat").Value = Text10.Text Data1.Recordset.Fields("harga_satuan").Value = Text7.Text Data1.Recordset.Fields("banyaknya").Value = Text12.Text Data1.Recordset.Fields("biaya_obat").Value = Text13.Text Data1.Recordset.Fields("keluhan").Value = Text8.Text Data1.Recordset.Fields("diagnosa").Value = Text9.Text Data1.Recordset.Fields("Tgl_Pesan").Value = Label22.Caption Data1.Recordset.update MsgBox "Tersimpan", vbinformation, "Pesan" Data1.Refresh M.Refresh Call tombol(0, 1, 0, 1, 1) cmdadd.setfocus Private Sub Combo1_KeyPress(KeyAscii As Integer) tmp = Combo1.List(Combo1.ListIndex) Dbpasien.Recordset.MoveFirst Do If Dbpasien.Recordset.Fields("No_Pasien").Value = tmp Then Text2.Text = Dbpasien.Recordset.Fields("Nama").Value Text3.Text = Dbpasien.Recordset.Fields("Jenis_Kelamin").Value Text4.Text = Dbpasien.Recordset.Fields("Umur").Value Text5.Text = Dbpasien.Recordset.Fields("Gol_Darah").Value Text6.Text = Dbpasien.Recordset.Fields("Alamat").Value Dbpasien.Recordset.MoveNext Loop Until Dbpasien.Recordset.EOF Call tombol(0, 1, 0, 0, 0) cmdadd.setfocus Private Sub Combo2_KeyPress(KeyAscii As Integer) tmp = Combo2.List(Combo2.ListIndex) Dbobat.Recordset.MoveFirst Do If tmp = Dbobat.Recordset.Fields("Kode_Obat").Value Then Text10.Text = Dbobat.Recordset.Fields("Nama_Obat").Value Text7.Text = Dbobat.Recordset.Fields("Harga_Satuan").Value Dbobat.Recordset.MoveNext Loop Until Dbobat.Recordset.EOF Text12.Text = ""
Text8.Text = "" Text9.Text = "" Text12.SetFocus Private Sub Command1_Click() Call tombol(0, 0, 0, 0, 0) Dbberobat.Recordset.Fields("No_Pendaftaran") = Text1.Text Dbberobat.Recordset.Fields("No_Pasien") = Combo1.Text Dbberobat.Recordset.Fields("Tgl_Berobat") = Format(Label22.Caption, "short date") Dbberobat.Recordset.Fields("Nama").Value = Text2.Text Dbberobat.Recordset.Fields("Biaya_Obat") = Label19.Caption Dbberobat.Recordset.update Dbberobat.Refresh frmcetak.show frmcetak.font = "Courier New" frmcetak.fontsize = "10" Data1.Recordset.MoveFirst mtotal = 0 mno = 0 mhal = 0 Do While Not Data1.Recordset.EOF mhal = mhal + 1 Tab(2); "DATA PASIEN BEROBAT" Tab(2); "Balai Pengobatan Pamulang Permai" Tab(2); "BLOK C 29 NO 17 Tlp 7493743" Tab(2); "No Pendaftaran = " & Text1.Text; Tab(50); "Tanggal Berobat= " & Label22.Caption Tab(2); "No Pasien = " & Combo1.Text; Tab(50); "Nama = " & Text2.Text Tab(50); "No Telp = " & Text6.Text Tab(30); "DAFTAR PEMESANAN OBAT" mgrs = String(100, "-") mgrs Tab(3); "No"; Tab(8); "Kode Obat"; Tab(18); "Nama"; Tab(30); "Harga"; Tab(40); "Item"; Tab(46); "Biaya"; Tab(52); "Keluhan"; Tab(75); "Diagnosa" mgrs msubtotal = 0 mbaris = 0 Do While Not Data1.Recordset.EOF And mbaris <= 55 mno = mno + 1 Tab(3); mno; Tab(8); Data1.Recordset.Fields(0); Tab(18); Data1.Recordset.Fields(1); Tab(30); Data1.Recordset.Fields(2);
Tab(40); Data1.Recordset.Fields(3); Tab(46); Data1.Recordset.Fields(4); Tab(52); Data1.Recordset.Fields(5); Tab(75); Data1.Recordset.Fields(6); mbaris = mbaris + 1 Data1.Recordset.MoveNext Loop mgrs Loop Tab(10); "Jumlah Total"; Tab(46); "" & Format(Label19.Caption, "Rp #,###,###"); Private Sub Form_Activate() Call tombol(1, 0, 0, 0, 0) Label22.Caption = Format(Date, "short date") Dbpasien.Recordset.MoveFirst Do Combo1.AddItem Dbpasien.Recordset.Fields(0).Value Dbpasien.Recordset.MoveNext Loop Until Dbpasien.Recordset.EOF Dbobat.Recordset.MoveFirst Do Combo2.AddItem Dbobat.Recordset.Fields(0).Value Dbobat.Recordset.MoveNext Loop Until Dbobat.Recordset.EOF M.ColWidth(0) = 700 M.ColWidth(1) = 1500 M.ColWidth(2) = 1000 M.ColWidth(3) = 1000 M.ColWidth(4) = 1000 M.ColWidth(5) = 2000 M.ColWidth(6) = 2000 Data1.DatabaseName = App.Path & "\diana1.mdb" Data1.RecordSource = Text1.Text Data1.Refresh Private Sub Form_Load() Dbpasien.DatabaseName = App.Path & "\diana1.mdb" Dbpasien.RecordSource = "pasien" Dbberobat.DatabaseName = App.Path & "\diana1.mdb" Dbberobat.RecordSource = "berobat" Data1.DatabaseName = App.Path & "\diana1.mdb" Dbobat.DatabaseName = App.Path & "\diana1.mdb" Dbobat.RecordSource = "data_obat" Call tombol(1, 0, 0, 0, 0) Private Sub Text1_KeyPress(KeyAscii As Integer) On Error GoTo salah If KeyAscii = 13 And Text1.Text <> "" Then mysqlstring = "CREATE TABLE " & Text1.Text & "" _ & "([Kode_Obat] TEXT (6),[Nama_Obat] TEXT (30), " _ & "[Harga_Satuan] TEXT (10),[Banyaknya] INTEGER,[biaya_obat] CURRENCY, " _ & "[Keluhan] TEXT (50),[Diagnosa] TEXT (50),Tgl_Pesan Date);" Data1.Database.Execute mysqlstring
Data1.DatabaseName = App.Path & "\diana1.mdb" Data1.RecordSource = Text1.Text Data1.Refresh Combo1.SetFocus salah: Select Case Err.Number Case 3010: MsgBox "No Kwitansi sudah ada", vbinformation, "Pesan" Text1.Text = "" Text1.SetFocus End Select Private Sub Text12_KeyPress(KeyAscii As Integer) If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbkeyback Or KeyAscii = 13) Then KeyAscii = 0 Dbobat.Recordset.MoveFirst Do If Dbobat.Recordset.Fields("sisa_stok").Value < Val(Text12.Text) Then MsgBox "Data Obat Melebihi Stok", vbinformation, "Pesan" Text12.SetFocus Dbobat.Recordset.MoveNext Loop Until Dbobat.Recordset.EOF Text13.Text = Val(Text7.Text) * Val(Text12.Text) Text8.SetFocus FORM PEMBAYARAN Sub tombol(add, update, cancel, cetak) cmdadd.enabled = add cmdupdate.enabled = update cmdcancel.enabled = cancel cmdcetak.enabled = cetak Sub kunci(x) Private Sub cmdadd_click() Call kunci(0) Call tombol(0, 1, 1, 0) If Not (Dbbayar.Recordset.EOF And Dbbayar.Recordset.BOF) Then Dbbayar.Recordset.MoveLast a = Dbbayar.Recordset.Fields(0).Value Else a = 0 b = Format$(Val(a) + 1, "000") Combo1.SetFocus
Dbbayar.Recordset.AddNew Label28.Caption = b Private Sub cmdcetak_click() On Error GoTo salah Call kunci(1) Call tombol(1, 0, 0, 0) Data1.RecordSource = "select kode_obat,nama_obat,harga_satuan,banyaknya,biaya_obat,keluhan,diagnosa from " & Combo1.Text Data1.Refresh 'tanya joko frmcetak.show frmcetak.font = "Courier New" frmcetak.fontsize = "10" Tab(2); "KWITANSI PEMBAYARAN" Tab(2); "PAMULANG PERMAI II C 29 NO 17 TLP 7493743" Tab(2); "TANGERANG BANTEN" Tab(2); "No Kwitansi = " & Label28.Caption Tab(2); "Tgl Sekarang = " & Label8.Caption; Tab(50); "Tgl Berobat = " & Label27.Caption Tab(30); "DAFTAR PEMESANAN OBAT" mgrs = String(100, "-") mgrs Tab(3); "No"; Tab(8); "Kode Obat"; Tab(18); "Nama"; Tab(30); "Harga"; Tab(40); "Item"; Tab(46); "Biaya"; Tab(52); "Keluhan"; Tab(75); "Diagnosa" mgrs msubtotal = 0 mbaris = 0 Do While Not Data1.Recordset.EOF And mbaris <= 55 mno = mno + 1 Tab(3); mno; Tab(8); Data1.Recordset.Fields(0); Tab(18); Data1.Recordset.Fields(1); Tab(30); Data1.Recordset.Fields(2); Tab(40); Data1.Recordset.Fields(3); Tab(46); Data1.Recordset.Fields(4); Tab(52); Data1.Recordset.Fields(5); Tab(75); Data1.Recordset.Fields(6); mbaris = mbaris + 1 Data1.Recordset.MoveNext Loop mgrs Tab(2); "Total = " & Format(Label29.Caption, "###,###,###") Tab(2); "Pembayaran = " & Format(Label32.Caption, "###,###,###") Tab(2); "Kembali = " & Format(Label30.Caption, "###,###,###") mgrs = String(80, "-")
mgrs Tab(70); "Kasir" Tab(70); "Diana" salah: Select Case Err.Number Case 482 MsgBox "Printer Error...", vbcritical, "Peringatan..." Unload frmcetak frmberobat.show Case Else MsgBox Err.Number & vbcrlf & Err.Description End Select Private Sub cmdexit_click() frmmenu.show Private Sub cmdupdate_click() Dbbayar.Recordset.Fields("No_Kwitansi").Value = Label28.Caption Dbbayar.Recordset.Fields("No_Pendaftaran").Value = Combo1.Text Dbbayar.Recordset.Fields("No_Pasien").Value = Label13.Caption Dbbayar.Recordset.Fields("Tgl").Value = Label8.Caption Dbbayar.Recordset.Fields("Biaya_Obat").Value = Label26.Caption Dbbayar.Recordset.Fields("Biaya_Pemeriksaan").Value = Label31.Caption Dbbayar.Recordset.Fields("Total").Value = Label29.Caption Dbbayar.Recordset.update MsgBox "Data Tersimpan...", vbokonly + vbinformation, "Pesan..." Dbbayar.Refresh Call kunci(1) Call tombol(1, 0, 0, 1) cmdadd.setfocus Private Sub Combo1_KeyPress(KeyAscii As Integer) tmp = Combo1.List(Combo1.ListIndex) Dbberobat.Recordset.MoveFirst Do If Dbberobat.Recordset.Fields("No_Pendaftaran").Value = tmp Then Label13.Caption = Dbberobat.Recordset.Fields("No_Pasien").Value c = Label13.Caption Label27.Caption = Dbberobat.Recordset.Fields("Tgl_berobat").Value Label26.Caption = Dbberobat.Recordset.Fields("Biaya_Obat").Value Do If Dbpasien.Recordset.Fields(0).Value = c Then Label16.Caption = Dbpasien.Recordset.Fields("nama").Value Label17.Caption = Dbpasien.Recordset.Fields("jenis_kelamin").Value Label23.Caption = Dbpasien.Recordset.Fields("umur").Value Label24.Caption = Dbpasien.Recordset.Fields("Gol_darah").Value Label25.Caption = Dbpasien.Recordset.Fields("alamat").Value Dbpasien.Recordset.MoveNext
Loop Until Dbpasien.Recordset.EOF Dbberobat.Recordset.MoveNext Loop Until Dbberobat.Recordset.EOF Data1.DatabaseName = App.Path & "\diana1.mdb" Data1.RecordSource = "select kode_obat,nama_obat,harga_satuan,banyaknya,biaya_obat,keluhan,diagnosa from " & Combo1.Text Data1.Refresh 'tanya joko M.Refresh Text7.SetFocus Private Sub Form_Activate() On Error GoTo salah Label8.Caption = Format(Date, shortdate) Dbberobat.Recordset.MoveFirst Do Combo1.AddItem Dbberobat.Recordset.Fields("No_Pendaftaran").Value Dbberobat.Recordset.MoveNext Loop Until Dbberobat.Recordset.EOF M.ColWidth(0) = 700 M.ColWidth(1) = 1500 M.ColWidth(2) = 1000 M.ColWidth(3) = 1000 M.ColWidth(4) = 1000 M.ColWidth(5) = 2000 M.ColWidth(6) = 2000 salah: Select Case Err.Number Case 3021: MsgBox "Tidak ada Pasien yang Berobat...", vbokonly + vbinformation, "Pesan" frmmenu.show End Select Private Sub Form_Load() Dbberobat.DatabaseName = App.Path & "\diana1.mdb" Dbberobat.RecordSource = "berobat" Dbbayar.DatabaseName = App.Path & "\diana1.mdb" Dbbayar.RecordSource = "Bayar" Dbobat.DatabaseName = App.Path & "\diana1.mdb" Dbobat.RecordSource = "Data_Obat" Dbpasien.DatabaseName = App.Path & "\diana1.mdb" Dbpasien.RecordSource = "Pasien" Data1.DatabaseName = App.Path & "\diana1.mdb" Private Sub Text12_KeyPress(KeyAscii As Integer) If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbkeyback Or KeyAscii = 13) Then KeyAscii = 0 Combo1.SetFocus
Private Sub Text18_KeyPress(KeyAscii As Integer) If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbkeyback Or KeyAscii = 13) Then KeyAscii = 0 Label30.Caption = Val(Text18.Text) - Val(Label29.Caption) If Val(Text18.Text) < Val(Label29.Caption) Then MsgBox "Uang Kurang...", vbokonly + vbinformation, "Pesan..." Text18.Text = "" Text18.SetFocus Label32.Caption = Text18.Text cmdupdate.setfocus Private Sub Text7_KeyPress(KeyAscii As Integer) If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbkeyback Or KeyAscii = 13) Then KeyAscii = 0 Label29.Caption = Val(Label26.Caption) + Val(Text7.Text) Label31.Caption = Text7.Text Text18.SetFocus FORM LAPORAN Private Sub Command1_Click() On Error GoTo salah x = Text1.Text Y = Text2.Text If Command1.Caption = "Laporan Pasien Berobat" Then Data1.RecordSource = "select * from berobat where Tgl_Berobat between " & "#" & "" & x & "" & "#" & " And " & "#" & "" & Y & "" & "#" & "" Data1.Refresh Label5.Caption = "DATA PASIEN BEROBAT DARI TANGGAL " & x & " SAMPAI TANGGAL " & Y & "" D.Caption = "DATA PASIEN BEROBAT" Command1.Caption = "Cetak" t = 0 Do t = t + Val(Data1.Recordset.Fields("Biaya_Obat").Value) Data1.Recordset.MoveNext Loop Until Data1.Recordset.EOF Label2.Caption = Format(t, "#,###,###") ElseIf Command1.Caption = "Cetak" Then MsgBox "Cetak frmcetak.show Data1.RecordSource = "select * from berobat where Tgl_Berobat between " & "#" & "" & x & "" & "#" & " And " & "#" & "" & Y & "" & "#" & "" Data1.Refresh Data1.Recordset.MoveFirst frmcetak.font = "Courier New"
frmcetak.fontsize = 8 mno = 0 mhal = 0 mbaris = 0 Do While Not Data1.Recordset.EOF mhal = mhal + 1 Tab(2); "LAPORAN PASIEN BEROBAT" Tab(2); "PAMULAMG PERMAI II C29 NO 17 TELP 7493743" Tab(2); "TANGERANG BANTEN" Tab(45); "LAPORAN PASIEN BEROBAT" Tab(32); "DATA PASIEN DARI TANGGAL " & x & " SAMPAI TANGGAL " & Y & "" Tab(105); "Hal : "; Format(mhal, "###") mgrs = String$(114, "=") Tab(1); mgrs Tab(2); "No"; Tab(5); "No Pendaftaran"; Tab(21); "No Pasien"; Tab(32); "Nama Pasien"; Tab(45); "Tgl Berobat"; Tab(57); "Biaya Obat" Tab(1); mgrs msubtotal = 0 mbaris = 0 Do While Not Data1.Recordset.EOF And mbaris <= 55 mno = mno + 1 Tab(2); Format(mno, "###"); Tab(6); Data1.Recordset.Fields("No_Pendaftaran"); Tab(22); Data1.Recordset.Fields("No_Pasien"); Tab(33); Data1.Recordset.Fields("Nama"); Tab(46); Data1.Recordset.Fields("Tgl_berobat"); Tab(58); Format(Data1.Recordset.Fields("Biaya_Obat"), "###,####,###") mbaris = mbaris + 1 Data1.Recordset.MoveNext Loop mtotal = mtotal + msubtotal Tab(1); mgrs Tab(2); "JUMLAH TOTAL" Tab(106); "" & Format(Label2.Caption, "###,####,###") Loop Command1.Caption = "Laporan Pasien Berobat" salah: Select Case Err.Number Case 3075: MsgBox "Isi Tanggal Dulu", vbinformation, "Pesan" Text1.SetFocus End Select Private Sub Command2_Click() If Command2.Caption = "Laporan Data Obat" Then Data1.RecordSource = "Data_Obat" Data1.Refresh
D.Caption = "DATA OBAT" Command2.Caption = "Cetak" ElseIf Command2.Caption = "Cetak" Then MsgBox "Cetak" frmcetak.show Data1.RecordSource = "Data_Obat" Data1.Refresh Data1.Recordset.MoveFirst frmcetak.font = "Courier New" frmcetak.fontsize = 10 mno = 0 mhal = 0 mbaris = 0 Do While Not Data1.Recordset.EOF mhal = mhal + 1 Tab(2); "LAPORAN DATA OBAT" Tab(2); "PAMULAMG PERMAI II C29 NO 17 TELP 7493743" Tab(2); "TANGERANG BANTEN" Tab(40); "LAPORAN DATA OBAT" Tab(90); "Hal : "; Format(mhal, "###") mgrs = String$(100, "=") Tab(1); mgrs Tab(2); "No"; Tab(5); "Kode Obat"; Tab(17); "Nama Obat"; Tab(33); "Stok"; Tab(41); "Sisa Stok"; Tab(53); "Harga Satuan" Tab(1); mgrs msubtotal = 0 mbaris = 0 Do While Not Data1.Recordset.EOF And mbaris <= 55 mno = mno + 1 Tab(2); Format(mno, "###"); Tab(6); Data1.Recordset.Fields("Kode_Obat"); Tab(18); Data1.Recordset.Fields("Nama_Obat"); Tab(34); Data1.Recordset.Fields("Stok"); Tab(44); Data1.Recordset.Fields("Sisa_stok"); Tab(56); Format(Data1.Recordset.Fields("Harga_Satuan"), "###,###") mbaris = mbaris + 1 Data1.Recordset.MoveNext Loop mtotal = mtotal + msubtotal Tab(1); mgrs Loop Command2.Caption = "Laporan Data Obat" Private Sub Command3_Click() On Error GoTo salah x = Text1.Text Y = Text2.Text
If Command3.Caption = "Laporan Pembayaran" Then Data1.RecordSource = "select * from bayar where Tgl between " & "#" & "" & x & "" & "#" & " And " & "#" & "" & Y & "" & "#" & "" Data1.Refresh D.Caption = "DATA PEMBAYARAN" Label5.Caption = "DATA PEMBAYARAN DARI TANGGAL " & x & " SAMPAI TANGGAL " & Y & "" Command3.Caption = "Cetak" t = 0 Do t = t + Val(Data1.Recordset.Fields("total").Value) Data1.Recordset.MoveNext Loop Until Data1.Recordset.EOF Label2.Caption = Format(t, "#,###,###") ElseIf Command3.Caption = "Cetak" Then MsgBox "Cetak" frmcetak.show Data1.RecordSource = "Bayar" Data1.Refresh Data1.Recordset.MoveFirst frmcetak.font = "Courier New" frmcetak.fontsize = 10 mno = 0 mhal = 0 mbaris = 0 Do While Not Data1.Recordset.EOF mhal = mhal + 1 Tab(2); "LAPORAN DATA PEMBAYARAN" Tab(2); "PAMULAMG PERMAI II C29 NO 17 TELP 7493743" Tab(2); "TANGERANG BANTEN" Tab(42); "LAPORAN DATA PEMBAYARAN" Tab(28); "DATA PEMBAYARAN DARI TANGGAL " & x & " SAMPAI TANGGAL " & Y & "" Tab(105); "Hal : "; Format(mhal, "###") mgrs = String$(114, "=") Tab(1); mgrs Tab(2); "No"; Tab(5); "No Kwitansi"; Tab(18); "No Pendaftaran"; Tab(35); "No Pasien"; Tab(45); "Tgl Bayar"; Tab(56); "Biaya Obat"; Tab(67); "Biaya Periksa"; Tab(83); "Total" Tab(1); mgrs msubtotal = 0 mbaris = 0 Do While Not Data1.Recordset.EOF And mbaris <= 55 mno = mno + 1 Tab(2); Format(mno, "###"); Tab(6); Data1.Recordset.Fields("No_Kwitansi"); Tab(19); Data1.Recordset.Fields("No_Pendaftaran"); Tab(36); Data1.Recordset.Fields("No_Pasien"); Tab(46); Data1.Recordset.Fields("Tgl"); Tab(57); Format(Data1.Recordset.Fields("Biaya_Obat"), "##,###,###"); Tab(69); Format(Data1.Recordset.Fields("Biaya_Pemeriksaan"), "##,###,###");
Tab(84); Format(Data1.Recordset.Fields("Total"), "###,####,###") mbaris = mbaris + 1 Data1.Recordset.MoveNext Loop mtotal = mtotal + msubtotal Tab(1); mgrs Tab(2); "JUMLAH TOTAL" Tab(85); "" & Format(Label2.Caption, "###,####,###") Loop Command3.Caption = "Laporan Pembayaran" salah: Select Case Err.Number Case 3075: MsgBox "Isi Tanggal Dulu", vbinformation, "Pesan" Text1.SetFocus End Select Private Sub Command4_Click() frmmenu.show Private Sub Form_Load() Data1.DatabaseName = App.Path & "\diana1.mdb" Data1.RecordSource = "" Private Sub Text1_KeyPress(KeyAscii As Integer) Text2.SetFocus Private Sub Text2_KeyPress(KeyAscii As Integer) Command1.SetFocus FORM CETAK Private Sub Form_KeyPress(KeyAscii As Integer) frmmenu.show
Form Menu Utama Input Data Pasien
Input Data Obat Input Data Berobat
Input Data Pembayaran Output Data Obat
Output Pasien Berobat Output Data Pembayaran
Kartu Berobat Kwitansi Pembayaran
BALAI PENGOBATAN PAMULANG PERMAI II BLOK C29 No.17 Telp. 7493743 FORMULIR No_Pasien : Nama : Umur : Jenis_Kelamin : Golongan Darah : Alamat :
BALAI PENGOBATAN PAMULANG PERMAI II BLOK C 29 No. 17 Telp. 7493743 KARTU STATUS No. Pasien : Nama : Umur : Jenis Kelamin : Alamat : Tanggal Berobat Keluhan Diagnosa