FRM DATA MAHASISWA
Private Sub Form_Load()
MDATA.Visible = False
MLAPORAN.Visible = False
MTRANSAKSI.Visible = False
End Sub
Private Sub MDOSEN_Click()
FrmDosen.Show
End Sub
Private Sub MLAT1_Click()
frmlat1.Show
End Sub
Private Sub MLAT2_Click()
Frmlat2.Show
End Sub
Private Sub MLAT3_Click()
frmlat3.Show
End Sub
Private Sub MLAT4_Click()
Frmlat4.Show
End Sub
Private Sub MLAT5_Click()
FrmLat5.Show
End Sub
Private Sub MLAT6_Click()
FRMLAT6.Show
End Sub
Private Sub MLAT7_Click()
Frmlat7.Show
End Sub
Private Sub MLOGIN_Click()
Frmlogin.Show
End Sub
Private Sub MLOGOUT_Click()
MDATA.Visible = False
MTRANSAKSI.Visible = False
MLAPORAN.Visible = False
Load Me
FRMMENU.MLOGIN.Visible = True
FRMMENU.MLOGOUT.Visible = False
End Sub
Private Sub MMAHASISWA_Click()
FrmMahasiswa.Show
End Sub
Private Sub MMATAKULIAH_Click()
FrmMatakuliyah.Show
End Sub
Private Sub Timer1_Timer()
Text3 = Format(Now, "DD/MM/YY")
Text4 = Format(Now, "HH:MM:SS")
End Sub
FRM PENCARIAN DATA
Private Sub Command1_Click()
On Error Resume Next
RSMAHASISWA.CommandType = adCmdText
RSMAHASISWA.RecordSource = Text1
RSMAHASISWA.Refresh
Text2 = RSMAHASISWA.Recordset.RecordCount
End Sub
FRM DATA SIMPAN
Private Sub CETAK_Click()
x
End Sub
Private Sub CMDBARU_Click()
BERSIH
Text1 = Clear
Text1.SetFocus
End Sub
Private Sub CMDBATAL_Click()
CMDHAPUS.Enabled = False
CMDEDIT.Enabled = False
CMDSIMPAN.Enabled = False
BERSIH
TAMPILDATA
End Sub
Private Sub TAMPILDATA()
RSMAHASISWA.CommandType = adCmdText
RSMAHASISWA.RecordSource = "Select * from
MAHASISWA"
RSMAHASISWA.Refresh
DataGrid1.Refresh
End Sub
Private Sub CMDCETAK_Click()
tri.ReportFileName = App.Path +
"/lapmahasiswa.RPT"
tri.RetrieveDataFiles
tri.WindowState = crptMaximized
tri.Action = 1
End Sub
Private Sub CMDEDIT_Click()
RSMAHASISWA.Recordset.Fields(1) = Text2
RSMAHASISWA.Recordset.Fields(2) = Text3
RSMAHASISWA.Recordset.Fields(3) = Text4
RSMAHASISWA.Recordset.Fields(4) = DTPicker1.Value
RSMAHASISWA.Recordset.Fields(5) = Text6
RSMAHASISWA.Recordset.Fields(6) = Text7
RSMAHASISWA.Recordset.Fields(7) = Text8
RSMAHASISWA.Recordset.Fields(8) = Text9
RSMAHASISWA.Recordset.Update
MsgBox ("Data Telah DiPerbaiki")
RSMAHASISWA.Refresh
TAMPILDATA
End Sub
Private Sub CMDHAPUS_Click()
A = MsgBox("YAKINKAH INGIN DI HAPUS?", vbYesNo,
"")
If A = vbYes Then
RSMAHASISWA.Recordset.Delete
RSMAHASISWA.Refresh
Else
Cancel = True
End If
Text1 = Clear
Text2.SetFocus
CMDHAPUS.Enabled = False
CMDEDIT.Enabled = False
CMDSIMPAN.Enabled = False
BERSIH
TAMPILDATA
End Sub
Private Sub CMDSIMPAN_Click()
If Text1 = "" Then
MsgBox ("NS
Harap Di isi")
Exit Sub
End If
If Text2 = "" Then
MsgBox ("Nama
Harap Di isi")
Exit Sub
End If
RSMAHASISWA.Recordset.AddNew
RSMAHASISWA.Recordset.Fields(0) = Text1
RSMAHASISWA.Recordset.Fields(1) = Text2
RSMAHASISWA.Recordset.Fields(2) = Text3
RSMAHASISWA.Recordset.Fields(3) = Text4
RSMAHASISWA.Recordset.Fields(4) = DTPicker1.Value
RSMAHASISWA.Recordset.Fields(5) = Text6
RSMAHASISWA.Recordset.Fields(6) = Text7
RSMAHASISWA.Recordset.Fields(7) = Text8
RSMAHASISWA.Recordset.Fields(8) = Text9
RSMAHASISWA.Recordset.Update
MsgBox ("Data Telah Disimpan")
RSMAHASISWA.Refresh
TAMPILDATA
End Sub
Private Sub Form_Load()
BERSIH
RSMAHASISWA.Refresh
Text1.MaxLength = 8
CMDSIMPAN.Enabled = False
CMDHAPUS.Enabled = False
CMDEDIT.Enabled = False
Text1 = Clear
End Sub
Private Sub BERSIH()
Text2 = Clear
Text3 = Clear
Text4 = Clear
Text6 = Clear
Text7 = Clear
Text8 = Clear
Text9 = Clear
End Sub
Private Sub Text1_Change()
Dim panjang As Byte
panjang = Len(Text1)
If panjang < 7 Then
Exit Sub
End If
RSMAHASISWA.CommandType = adCmdText
RSMAHASISWA.RecordSource = "select*from mahasiswa Where
NIS ='" & Text1 & "'"
RSMAHASISWA.Refresh
If Not RSMAHASISWA.Recordset.EOF Then
MsgBox ("NIS SUDAH ADA")
Text2 = RSMAHASISWA.Recordset.Fields(1)
Text3 = RSMAHASISWA.Recordset.Fields(2)
Text4 = RSMAHASISWA.Recordset.Fields(3)
DTPicker1.Value = RSMAHASISWA.Recordset.Fields(4)
Text6 = RSMAHASISWA.Recordset.Fields(5)
Text7 = RSMAHASISWA.Recordset.Fields(6)
Text8 = RSMAHASISWA.Recordset.Fields(7)
Text9 = RSMAHASISWA.Recordset.Fields(8)
CMDSIMPAN.Enabled = False
CMDHAPUS.Enabled = True
CMDEDIT.Enabled = True
Else
BERSIH
Text2.SetFocus
CMDSIMPAN.Enabled = True
CMDHAPUS.Enabled = False
CMDEDIT.Enabled = False
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.SetFocus
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text7.SetFocus
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text8.SetFocus
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text9.SetFocus
End If
End Sub
FRM MENU
Private Sub Form_Load()
MDATA.Visible = False
MLAPORAN.Visible = False
MTRANSAKSI.Visible = False
End Sub
Private Sub MDOSEN_Click()
FrmDosen.Show
End Sub
Private Sub MLAT1_Click()
frmlat1.Show
End Sub
Private Sub MLAT2_Click()
Frmlat2.Show
End Sub
Private Sub MLAT3_Click()
frmlat3.Show
End Sub
Private Sub MLAT4_Click()
Frmlat4.Show
End Sub
Private Sub MLAT5_Click()
FrmLat5.Show
End Sub
Private Sub MLAT6_Click()
FRMLAT6.Show
End Sub
Private Sub MLAT7_Click()
Frmlat7.Show
End Sub
Private Sub MLOGIN_Click()
Frmlogin.Show
End Sub
Private Sub MLOGOUT_Click()
MDATA.Visible = False
MTRANSAKSI.Visible = False
MLAPORAN.Visible = False
Load Me
FRMMENU.MLOGIN.Visible = True
FRMMENU.MLOGOUT.Visible = False
End Sub
Private Sub MMAHASISWA_Click()
FrmMahasiswa.Show
End Sub
Private Sub MMATAKULIAH_Click()
FrmMatakuliyah.Show
End Sub
Private Sub Timer1_Timer()
Text3 = Format(Now, "DD/MM/YY")
Text4 = Format(Now, "HH:MM:SS")
End Sub
Tidak ada komentar:
Posting Komentar