Beruflich Dokumente
Kultur Dokumente
Private Sub Enroll_regs_Click() frmMaterial.Visible = False frmTrainingSchedule.Visible = False Attemdanceform.Visible = False Feedbackform.Visible = False EnrolRegis.Visible = True EnrolRegis.WindowState = 2
End Sub
Private Sub M_strog_Click() EnrolRegis.Visible = False frmTrainingSchedule.Visible = False Feedbackform.Visible = False Attemdanceform.Visible = False frmMaterial.Visible = True frmMaterial.WindowState = 2 End Sub
End Sub
Private Sub T_attend_Click() EnrolRegis.Visible = False frmMaterial.Visible = False frmTrainingSchedule.Visible = False Feedbackform.Visible = False
Private Sub T_feedbk_Click() EnrolRegis.Visible = False frmMaterial.Visible = False frmTrainingSchedule.Visible = False Attemdanceform.Visible = False Feedbackform.Visible = True Feedbackform.WindowState = 2 End Sub
Private Sub T_sche_Click() EnrolRegis.Visible = False frmMaterial.Visible = False Feedbackform.Visible = False Attemdanceform.Visible = False frmTrainingSchedule.Visible = True frmTrainingSchedule.WindowState = 2 End Sub
Private Sub cmdbrows_Click() If txtenrollno.Text <> "" Then CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then Picture1.Picture = LoadPicture(CommonDialog1.FileName) filName = 1 strf = CommonDialog1.FileName While Not filName = 0 filName = InStr(1, strf, "\") temp = Mid(strf, filName + 1) strf = temp Wend
temp = txtenrollno.Text & "_" & temp newfilename = "C:\WINNT\SYSTEM32\TRAININGMST\photo\" & temp
txtpath.Text = newfilename
MsgBox "Please select the Registrationno & name first !" End If Exit Sub End Sub
Private Sub cmdcnamedel_Click() If txtcname.Text <> "" Then If MsgBox("Are U Sure U want to Delete Course?", vbInformation + vbYesNo) = vbNo Then Exit Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from enrollregis where ucase(Tcname)='" & UCase(txtcname.Text) & "'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then MsgBox "Transacted Data Can`t be Deleted!", vbInformation txtcname.SetFocus Exit Sub End If
Set rsd = New ADODB.Recordset rsd.CursorLocation = adUseClient rsd.Open "Delete Cname from Category where ucase(Cname)='" & UCase(txtcname.Text) & "' and ucase(ctype) = 'COURSE' ", con, adOpenDynamic, adLockOptimistic
rs.Open "Select distinct Cname from Category where ucase(ctype) = 'COURSE' order by cname ", con, adOpenDynamic, adLockOptimistic txtcname.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtcname.AddItem rs.Fields(0) rs.MoveNext Loop
End If
End Sub
Private Sub cmdctdel_Click() If txtcity.Text <> "" Then If MsgBox("Are U Sure U want to Delete City?", vbInformation + vbYesNo) = vbNo Then Exit Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from enrollregis where ucase(TCITY)='" & UCase(txtcity.Text) & "'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then MsgBox "Transacted Data Can`t be Deleted!", vbInformation txtcity.SetFocus Exit Sub End If
Set rsd = New ADODB.Recordset rsd.CursorLocation = adUseClient rsd.Open "Delete Cname from Category where ucase(Cname)='" & UCase(txtcity.Text) & "' and ucase(ctype) = 'CITY' ", con, adOpenDynamic, adLockOptimistic
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'CITY' order by cname ", con, adOpenDynamic, adLockOptimistic txtcity.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtcity.AddItem rs.Fields(0) rs.MoveNext Loop
End If
End Sub
Private Sub cmddel_Click() If txtenrollno.Text = "" Then MsgBox "PLEASE SELECT THE RECORD TO DELETE", vbInformation Exit Sub End If
rs.CursorLocation = adUseClient If txtenrollno.Text <> "" Then If MsgBox("Are You Sure You Want To Delete?", vbQuestion + vbYesNo) = vbNo Then Exit Sub
' Dim rs1 As New ADODB.Recordset ' rs1.CursorLocation = adUseClient ' rs1.Open "Select * from enrollregis where ucase(Tenrollno)= '" & UCase(txtenrollno.Text) & "'", con, adOpenDynamic, adLockOptimistic ' If rs1.RecordCount > 0 Then ' ' MsgBox " This Student Should Not Be Deleted", vbCritical Exit Sub
'End If
rs.Open "delete from enrollregis where val(Tenrollno)=" & Val(txtenrollno.Text), con, adOpenDynamic, adLockOptimistic
End If
ClearTextBox
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from enrollregis order by tenrollno desc", con, adOpenDynamic, adLockOptimistic Set editgrid.DataSource = rs
End Sub
Set rs1 = New ADODB.Recordset rs1.CursorLocation = adUseClient rs1.Open "SELECT * FROM enrollregis order by Tenrollno desc", con, adOpenDynamic, adLockOptimistic
End Sub
Private Sub cmdqulidel_Click() If txtquali.Text <> "" Then If MsgBox("Are U Sure U want to Delete Qualification?", vbInformation + vbYesNo) = vbNo Then Exit Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from enrollregis where ucase(Tquali)='" & UCase(txtquali.Text) & "'", con, adOpenDynamic, adLockOptimistic
If rs.RecordCount > 0 Then MsgBox "Transacted Data Can`t be Deleted!", vbInformation txtquali.SetFocus Exit Sub End If
Set rsd = New ADODB.Recordset rsd.CursorLocation = adUseClient rsd.Open "Delete Cname from Category where ucase(Cname)='" & UCase(txtquali.Text) & "' and ucase(ctype) = 'QUALI' ", con, adOpenDynamic, adLockOptimistic
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'QUALI' order by cname ", con, adOpenDynamic, adLockOptimistic txtquali.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtquali.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from enrollregis", con, adOpenDynamic, adLockOptimistic
rs.Find ("Tenrollno = '" & txtenrollno.Text & "'") If rs.EOF = True Then rs.AddNew Else If MsgBox("Record Exist ! Overwrite?", vbYesNo + vbQuestion) = vbNo Then Exit Sub End If
rs.Fields("tdate") = txtdate.Value
If txtname.Text <> "" Then rs.Fields("Tname") = txtname.Text Else rs.Fields("Tname") = "" If txtadd1.Text <> "" Then rs.Fields("Tadd1") = txtadd1.Text Else rs.Fields("Tadd1") = "" If txtadd2.Text <> "" Then rs.Fields("Tadd2") = txtadd2.Text Else rs.Fields("Tadd2") = ""
If txtstate.Text <> "" Then rs.Fields("Tstate") = txtstate.Text Else rs.Fields("Tstate") = "" If txtphno.Text <> "" Then rs.Fields("Tphno") = txtphno.Text Else rs.Fields("Tphno") = "" If txthome.Text <> "" Then rs.Fields("Thome") = txthome.Text Else rs.Fields("Thome") = "NILL" If txtcname.Text <> "" Then rs.Fields("Tcname") = txtcname.Text Else rs.Fields("Tcname") = ""
If txtaofi.Text <> "" Then rs.Fields("Taofi") = txtaofi.Text Else rs.Fields("Taofi") = "" If txtpath.Text <> "" Then rs.Fields("Tphoto") = txtpath.Text Else rs.Fields("Tphoto") = ""
rs.Update MsgBox "Record is Saved!" Call ClearTextBox End Sub Sub ClearTextBox() Dim pcont As Control For Each pcont In Me.Controls If TypeOf pcont Is TextBox Or TypeOf pcont Is ComboBox Then pcont.Text = "" Picture1.Picture = Nothing txthome.Mask = "(####)-(#######)" txtdate.Value = Date Next End Sub Public Function auto_gen() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient
rs.Open "select max(Tenrollno) from enrollregis", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then If rs.Fields(0) <> "" Then txtenrollno.Text = rs.Fields(0) + 1 Else txtenrollno.Text = 1 End If End If End Function
End Sub
Private Sub cmdstdel_Click() If txtstate.Text <> "" Then If MsgBox("Are U Sure U want to Delete City?", vbInformation + vbYesNo) = vbNo Then Exit Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from enrollregis where ucase(Tstate)='" & UCase(txtstate.Text) & "'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then MsgBox "Transacted Data Can`t be Deleted!", vbInformation txtstate.SetFocus Exit Sub
End If
Set rsd = New ADODB.Recordset rsd.CursorLocation = adUseClient rsd.Open "Delete Cname from Category where ucase(Cname)='" & UCase(txtstate.Text) & "' and ucase(ctype) = 'STATE' ", con, adOpenDynamic, adLockOptimistic
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'STATE' order by cname ", con, adOpenDynamic, adLockOptimistic txtstate.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtstate.AddItem rs.Fields(0) rs.MoveNext Loop
End If
End Sub
Private Sub cmdupdtcity_Click() If txtnewcity.Text <> "" Then Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select * from Category where ucase(ctype) = 'CITY' AND UCASE(CNAME) = '" & UCase(txtnewcity.Text) & "' ", con, adOpenDynamic, adLockOptimistic
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'CITY' order by cname ", con, adOpenDynamic, adLockOptimistic txtcity.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtcity.AddItem rs.Fields(0) rs.MoveNext Loop
frmcname.Visible = True frmcname.ZOrder txtnewcors.Text = "" If frmcname.Visible = True Then txtnewcors.SetFocus End Sub
Private Sub cmdupdtcors_Click() If txtnewcors.Text <> "" Then Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select * from Category where ucase(ctype) = 'COURSE' AND UCASE(CNAME) = '" & UCase(txtnewcors.Text) & "' ", con, adOpenDynamic, adLockOptimistic
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'COURSE' order by cname ", con, adOpenDynamic, adLockOptimistic
txtcname.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtcname.AddItem rs.Fields(0) rs.MoveNext Loop
End Sub
Private Sub cmdupdtct_Click() frmcity.Visible = True frmcity.ZOrder txtnewcity.Text = "" If frmcity.Visible = True Then txtnewcity.SetFocus
End Sub
End Sub
Private Sub cmdupdtquli_Click() If txtnewquli.Text <> "" Then Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select * from Category where ucase(ctype) = 'QUALI' AND UCASE(CNAME) = '" & UCase(txtnewquli.Text) & "' ", con, adOpenDynamic, adLockOptimistic
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'QUALI' order by cname ", con, adOpenDynamic, adLockOptimistic txtquali.clear Do While Not rs.EOF
End If
End Sub
Private Sub cmdupdtst_Click() frmstate.Visible = True frmstate.ZOrder txtnewstat.Text = "" If frmstate.Visible = True Then txtnewstat.SetFocus End Sub
Private Sub cmdupdtstat_Click() If txtnewstat.Text <> "" Then Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select * from Category where ucase(ctype) = 'STATE' AND UCASE(CNAME) = '" & UCase(txtnewstat.Text) & "' ", con, adOpenDynamic, adLockOptimistic
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'STATE' order by cname ", con, adOpenDynamic, adLockOptimistic txtstate.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtstate.AddItem rs.Fields(0) rs.MoveNext Loop
End If
End Sub
End Sub
Private Sub editgrid_Click() Dim rs1 As ADODB.Recordset Set rs1 = New ADODB.Recordset rs1.CursorLocation = adUseClient
rs1.Open "select * from enrollregis where [Tenrollno] = " & Val(editgrid.Columns(0)) & " ORDER BY tenrollno", con, adOpenDynamic, adLockOptimistic
If rs1.Fields("Tenrollno") <> "" Then txtenrollno.Text = rs1.Fields("Tenrollno") Else txtenrollno.Text = 0 If rs1.Fields("Tdate") <> "" Then txtdate.Value = rs1.Fields("Tdate") If rs1.Fields("Tname") <> "" Then txtname.Text = rs1.Fields("Tname") Else txtname.Text = "" If rs1.Fields("Tadd1") <> "" Then txtadd1.Text = rs1.Fields("Tadd1") Else txtadd1.Text = "" If rs1.Fields("Tadd2") <> "" Then txtadd2.Text = rs1.Fields("Tadd2") Else txtadd2.Text = "" If rs1.Fields("Tcity") <> "" Then txtcity.Text = rs1.Fields("Tcity") Else txtcity.Text = "" If rs1.Fields("Tstate") <> "" Then txtstate.Text = rs1.Fields("Tstate") Else txtstate.Text = "" If rs1.Fields("Tphno") <> "" Then txtphno.Text = rs1.Fields("Tphno") Else txtphno.Text = "" If rs1.Fields("Thome") <> "" Then txthome.Text = rs1.Fields("Thome") Else txthome.Text = "" If rs1.Fields("Tcname") <> "" Then txtcname.Text = rs1.Fields("Tcname") Else txtcname.Text = "" If rs1.Fields("Tquali") <> "" Then txtquali.Text = rs1.Fields("Tquali") Else txtquali.Text = "" If rs1.Fields("Taofi") <> "" Then txtaofi.Text = rs1.Fields("Taofi") Else txtaofi.Text = ""
If rs1.Fields("Tphoto") <> "" Then newfilename = rs1.Fields("Tphoto") Else newfilename = "" If rs1.Fields("Tphoto") <> "" Then Picture1.Picture = LoadPicture(newfilename) Else Picture1.Picture = Nothing
cmdadd.TabIndex = 0 txtenrollno.TabIndex = 1 txtdate.TabIndex = 2 txtname.TabIndex = 3 txtadd1.TabIndex = 4 txtadd2.TabIndex = 5 txtphno.TabIndex = 6 txthome.TabIndex = 7 txtcity.TabIndex = 8 txtstate.TabIndex = 9 txtcname.TabIndex = 10 txtquali.TabIndex = 11 txtaofi.TabIndex = 12 cmdbrows.TabIndex = 13
frmstate.Visible = False
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct CNAME from category where ucase(ctype) = 'CITY' order by CNAME ", con, adOpenDynamic, adLockOptimistic txtcity.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtcity.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'STATE' order by cname ", con, adOpenDynamic, adLockOptimistic txtstate.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtstate.AddItem rs.Fields(0) rs.MoveNext Loop
rs.Open "Select distinct Cname from Category where ucase(ctype) = 'COURSE' order by cname ", con, adOpenDynamic, adLockOptimistic txtcname.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtcname.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'QUALI' order by cname ", con, adOpenDynamic, adLockOptimistic txtquali.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtquali.AddItem rs.Fields(0) rs.MoveNext Loop
End Sub
'Private Sub Text1_LostFocus() 'Text1.Text = "(" & Text1.Text & ")" 'End Sub
Private Sub txtadd2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtcity_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtcity_LostFocus() Dim b As Integer b=0 If txtcity.Text <> "" Then For i = 0 To txtcity.ListCount - 1 If txtcity.Text = txtcity.List(i) Then b=1 Exit For End If Next i
Private Sub txtcname_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtcname_LostFocus() Dim a As Integer a=0 If txtcname.Text <> "" Then For i = 0 To txtcname.ListCount - 1 If txtcname.Text = txtcname.List(i) Then a=1 Exit For End If Next i
If a = 0 Then MsgBox "Please Select From List Only !!", vbInformation txtcname.Text = ""
Private Sub txtdate_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txthome_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtname_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtnewcity_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtnewcors_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtnewquli_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtnewstat_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtphno_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtquali_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
a=0 If txtquali.Text <> "" Then For i = 0 To txtquali.ListCount - 1 If txtquali.Text = txtquali.List(i) Then a=1 Exit For End If Next i
If a = 0 Then MsgBox "Please Select From List Only !!", vbInformation txtquali.Text = "" txtquali.SetFocus Exit Sub End If End If End Sub
Private Sub txtstate_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
If txtstate.Text <> "" Then For i = 0 To txtstate.ListCount - 1 If txtstate.Text = txtstate.List(i) Then a=1 Exit For End If Next i
If a = 0 Then MsgBox "Please Select From List Only !!", vbInformation txtstate.Text = "" txtstate.SetFocus Exit Sub End If End If End Sub
Private Sub cmbcourse_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub cmbcourse_LostFocus() Dim i As Integer a=0 If cmbcourse.Text <> "" Then For i = 0 To cmbcourse.ListCount - 1 If cmbcourse.Text = cmbcourse.List(i) Then a=1 Exit For End If Next i If a = 0 Then MsgBox "Please Select from list Only", vbInformation cmbcourse.Text = "" cmbcourse.SetFocus Exit Sub End If End If End Sub
Private Sub cmbtopic_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub cmdadd_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdadd.BackColor = &HFF8080
End Sub
If MsgBox(" Are U Sure U want to delete Area?", vbInformation + vbYesNo) = vbNo Then Exit Sub Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from TRANSCHE where ucase(cname)= '" & UCase(cmbcourse.Text) & "' ", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then MsgBox "Transected data Can't be Deleted!", vbInformation cmbcourse.SetFocus Exit Sub End If
Set rsd = New ADODB.Recordset rsd.CursorLocation = adUseClient rsd.Open "Delete cname from Category where ucase(cname)='" & UCase(cmbcourse.Text) & "' and ucase(ctype)='course'", con, adOpenDynamic, adLockOptimistic Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct cname from category where ucase(ctype) = 'COURSE' order by cname", con, adOpenDynamic, adLockOptimistic cmbcourse.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbcourse.AddItem rs.Fields(0) rs.MoveNext
Loop
End If
End Sub
Private Sub cmdcourseupdt_Click() If txtupdtcourse.Text <> "" Then Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select * from category where ucase(ctype) = 'COURSE' AND UCASE(cname) = '" & UCase(txtupdtcourse.Text) & "' ", con, adOpenDynamic, adLockOptimistic If rs.RecordCount = 0 Then rs.AddNew rs.Fields("cname") = txtupdtcourse.Text rs.Fields("ctype") = "COURSE" rs.Update End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct cname from category where ucase(ctype) = 'COURSE'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbcourse.clear Do While Not rs.EOF
If rs.Fields(0) <> "" Then cmbcourse.AddItem rs.Fields(0) rs.MoveNext Loop End If End If
Private Sub cmddelete_Click() If MsgBox("Are You Sure You Want to Delete Record", vbYesNo) = vbNo Then Exit Sub Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "delete from TRANSCHE where Tno =" & Val(txttrano.Text), con, adOpenDynamic, adLockOptimistic MsgBox "Record is Deleted!", vbOKOnly
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from TRANSCHE", con, adOpenDynamic, adLockOptimistic Set gridsearch.DataSource = rs clear
End Sub
Private Sub cmddelete_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmddelete.BackColor = &HFF8080 End Sub
Private Sub cmdedit_Click() fraedit.Visible = True Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from TRANSCHE order by Tno desc", con, adOpenDynamic, adLockOptimistic Set gridsearch.DataSource = rs
End Sub
Private Sub cmdedit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdedit.BackColor = &HFF8080 End Sub
Private Sub cmdexit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdexit.BackColor = &HFF8080 End Sub
Private Sub cmdprint_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdprint.BackColor = &HFF8080 End Sub
If txttrano.Text = "" Then MsgBox "Please Click on ADD Button!" cmdadd.SetFocus Exit Sub End If Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from TRANSCHE", con, adOpenDynamic, adLockOptimistic rs.Find ("Tno = '" & txttrano.Text & "'") If rs.EOF = True Then rs.AddNew Else If MsgBox("Record Exist ! Overwrite?", vbYesNo + vbQuestion) = vbNo Then Exit Sub End If If txttrano.Text <> "" Then rs.Fields(0) = txttrano.Text Else rs.Fields(0) = "" If txtdate.Value <> "__/__/____" Then rs.Fields(1) = txtdate.Value Else rs.Fields(1) = "__/__/____" If txttraname.Text <> "" Then rs.Fields(2) = txttraname.Text Else rs.Fields(2) = "" If cmbcourse.Text <> "" Then rs.Fields(3) = cmbcourse.Text Else rs.Fields(3) = ""
If cmbtopic.Text <> "" Then rs.Fields(4) = cmbtopic.Text Else rs.Fields(4) = "" If txttfrom.Value <> "" Then rs.Fields(5) = txttfrom.Value Else rs.Fields(5) = "" If txttto.Value <> "" Then rs.Fields(6) = txttto.Value Else rs.Fields(6) = ""
End Sub
Private Sub cmdsave_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsave.BackColor = &HFF8080 End Sub
Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
End Sub
If MsgBox(" Are U Sure U want to delete Topic?", vbInformation + vbYesNo) = vbNo Then Exit Sub Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from TRANSCHE where ucase(topicname)= '" & UCase(cmbtopic.Text) & "' ", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then MsgBox "Transected data Can't be Deleted!", vbInformation cmbtopic.SetFocus Exit Sub End If
rsd.Open "Delete cname from Category where ucase(cname)='" & UCase(cmbtopic.Text) & "' and ucase(ctype)='TOPIC'", con, adOpenDynamic, adLockOptimistic Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct cname from category where ucase(ctype) = 'TOPIC' order by cname", con, adOpenDynamic, adLockOptimistic cmbtopic.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbtopic.AddItem rs.Fields(0) rs.MoveNext Loop
End If
End Sub
Private Sub cmdtopicupdt_Click() 'Frame6.Visible = False If txtupdttopic.Text <> "" Then Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select * from category where ucase(ctype) = 'TOPIC' AND UCASE(cname) = '" & UCase(txtupdttopic.Text) & "' ", con, adOpenDynamic, adLockOptimistic If rs.RecordCount = 0 Then rs.AddNew rs.Fields("cname") = txtupdttopic.Text rs.Fields("ctype") = "TOPIC"
rs.Update End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct cname from category where ucase(ctype) = 'TOPIC'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbtopic.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbtopic.AddItem rs.Fields(0) rs.MoveNext Loop End If End If
End Sub
Dim rs1 As ADODB.Recordset Set rs1 = New ADODB.Recordset rs1.CursorLocation = adUseClient rs1.Open "select * from TRNIGRGSTR where [TRnum] = " & Val(editgrid.Columns(0)) & " ORDER BY pRnum", con, adOpenDynamic, adLockOptimistic
If rs1.Fields("TRnum") <> "" Then txttraingno.Text = rs1.Fields("TRnum") Else txttraingno.Text = 0 If rs1.Fields("TRspeakernm") <> "" Then txtspekernm.Text = rs1.Fields("TRspeakernm") Else txtspekernm.Text = "" If rs1.Fields("TRdate") <> "" Then txtdate.Value = Date If rs1.Fields("TRfrmtime") <> "" Then txtfrmtime.Value = rs1.Fields("TRfrmtime") Else txtfrmtime.Value = "" If rs1.Fields("TRtotime") <> "" Then txttotime.Value = rs1.Fields("TRtotime") Else txttotime.Value = "" If rs1.Fields("TRtopic") <> "" Then txttopic.Text = rs1.Fields("TRtopic") Else txttopic.Text = ""
End If End If
End Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct cname from category where ucase(ctype) = 'COURSE'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbcourse.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbcourse.AddItem rs.Fields(0) rs.MoveNext Loop End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct cname from category where ucase(ctype) = 'TOPIC'", con, adOpenDynamic, adLockOptimistic
If rs.RecordCount > 0 Then cmbtopic.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbtopic.AddItem rs.Fields(0) rs.MoveNext Loop End If
fraedit.Visible = False Frame6.Visible = False Frame5.Visible = False txttfrom.Value = Time txttto.Value = Time txtdate.Value = Date
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdadd.BackColor = &HFFC0C0 cmdsave.BackColor = &HFFC0C0 cmdedit.BackColor = &HFFC0C0 cmddelete.BackColor = &HFFC0C0 cmdprint.BackColor = &HFFC0C0 cmdexit.BackColor = &HFFC0C0 End Sub
cmddelete.Enabled = True
Dim rsfill As ADODB.Recordset Set rsfill = New ADODB.Recordset rsfill.CursorLocation = adUseClient rsfill.Open "select * from TRANSCHE where [Tno] = " & Val(gridsearch.Columns(0)) & " ORDER BY TNO", con, adOpenDynamic, adLockOptimistic
If rsfill.RecordCount > 0 Then If rsfill.BOF = False Then rsfill.MoveFirst If rsfill.Fields("Tno") <> "" Then txttrano.Text = rsfill.Fields("Tno") Else TxtSno.Text = 0 If rsfill.Fields("Tdate") <> "" Then txtdate.Value = rsfill.Fields("Tdate") If rsfill.Fields("Trainername") <> "" Then txttraname.Text = rsfill.Fields("Trainername") Else txttraname.Text = "" If rsfill.Fields("cname") <> "" Then cmbcourse.Text = rsfill.Fields("cname") Else cmbcourse.Text = "" If rsfill.Fields("topicname") <> "" Then cmbtopic.Text = rsfill.Fields("topicname") Else cmbtopic.Text = "" If rsfill.Fields("tfrmtime") <> "" Then txttfrom.Value = rsfill.Fields("tfrmtime") Else txttfrom.Value = "" If rsfill.Fields("ttotime") <> "" Then txttto.Value = rsfill.Fields("ttotime") Else txttto.Value = "" rsfill.MoveNext 'txtename.SetFocus End If
cmdsave.Enabled = True
End Sub
Private Sub txtdate_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txtsearchname_Change() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from TRANSCHE where ucase(Trainername) like '" & UCase(txtsearchname.Text) & "%'", con, adOpenDynamic, adLockOptimistic Set gridsearch.DataSource = rs
End Sub
Private Sub txttfrom_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txttraname_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
End Sub
Private Sub txttrano_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txttto_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Public Sub code_auto() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select max(Tno) from TRANSCHE", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then If rs.Fields(0) <> "" Then txttrano.Text = rs.Fields(0) + 1 Else
End Sub
Public Sub clear() txttraname.Text = "" cmbcourse.Text = "" cmbtopic.Text = "" txttrano.Text = "" End Sub
Dim NewFile1 As String Dim rs As ADODB.Recordset Dim rs1 As ADODB.Recordset Dim RSPRN As ADODB.Recordset
End Sub
Private Sub cmdadd_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdadd.BackColor = &HFF8080 End Sub
Private Sub cmddel_Click() If MsgBox("Are You Sure You Want to Delete Record", vbYesNo) = vbNo Then Exit Sub Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "delete from MaterialMGT where tno=" & Val(TXTTNO.Text), con, adOpenDynamic, adLockOptimistic MsgBox "Record is Deleted!", vbOKOnly
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from MaterialMGT", con, adOpenDynamic, adLockOptimistic Set editgrid.DataSource = rs Call ClearTextBox End Sub
Private Sub cmddel_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmddel.BackColor = &HFF8080 End Sub
rs.CursorLocation = adUseClient rs.Open "SELECT * FROM MaterialMGT order by tno desc", con, adOpenDynamic, adLockOptimistic Set editgrid.DataSource = rs frmeditgrid.Visible = True frmeditgrid.ZOrder End Sub
Private Sub cmdedit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdedit.BackColor = &HFF8080 End Sub
Private Sub cmdexit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdexit.BackColor = &HFF8080 End Sub
If txtfedby.Text <> "" Then If MsgBox("Are U Sure U want to Delete?", vbInformation + vbYesNo) = vbNo Then Exit Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from MaterialMGT where ucase(tFedby)='" & UCase(txtfedby.Text) & "'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then MsgBox "Transacted Data Can`t be Deleted!", vbInformation txtfedby.SetFocus Exit Sub End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "delete from Category where ucase(ctype)='FEDBY' AND ucase(CNAME) = '" & UCase(txtfedby.Text) & "'", con, adOpenDynamic, adLockOptimistic
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Cname from Category where ucase(ctype) = 'FEDBY' order by cname ", con, adOpenDynamic, adLockOptimistic txtfedby.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtfedby.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from CATEGORY where ucase(ctype)='FEDBY' AND UCASE(CNAME) = '" & UCase(txtfedupdt.Text) & "' ", con, adOpenDynamic, adLockOptimistic If rs.RecordCount = 0 Then rs.AddNew
rs.Update End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct CNAME from CATEGORY where ucase(ctype) = 'FEDBY' order by CNAME ", con, adOpenDynamic, adLockOptimistic txtfedby.clear Do While Not rs.EOF
'Private Sub cmdprint_Click() 'Dim Report As New DES_TRAINING 'Report.DiscardSavedData ' 'Set RSPRN = New ADODB.Recordset 'RSPRN.CursorLocation = adUseClient 'RSPRN.Open "DELETE FROM temptraining", trancon, adOpenDynamic, adLockOptimistic ' 'Set RSPRN = New ADODB.Recordset 'RSPRN.CursorLocation = adUseClient 'RSPRN.Open "SELECT * FROM temptraining", trancon, adOpenDynamic, adLockOptimistic ' 'Set rs = New ADODB.Recordset 'rs.CursorLocation = adUseClient 'rs.Open "SELECT * FROM training where [sno]= " & txtautogen.Text & "", trancon, adOpenDynamic, adLockOptimistic
' 'Do While Not rs.EOF ' RSPRN.AddNew ' ' ' For i = 0 To rs.Fields.Count - 1 RSPRN.Fields(i) = rs.Fields(i) Next i
' RSPRN.Update 'rs.MoveNext 'Loop ' 'Set RSPRN = New ADODB.Recordset 'RSPRN.CursorLocation = adUseClient 'RSPRN.Open "SELECT * FROM temptraining", trancon, adOpenDynamic, adLockOptimistic 'Report.Database.SetDataSource RSPRN ' ' 'Report.PrinterSetup (0) 'TRAcrviewerFRM.CRViewer1.ReportSource = Report 'TRAcrviewerFRM.CRViewer1.ViewReport 'TRAcrviewerFRM.WindowState = 2 'TRAcrviewerFRM.Caption = "TRAINING FORM" 'TRAcrviewerFRM.CRViewer1.Zoom (100) 'TRAcrviewerFRM.Show 'End Sub
Private Sub cmdprint_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdprint.BackColor = &HFF8080 End Sub
Private Sub cmdsave_Click() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from MaterialMGT", con, adOpenDynamic, adLockOptimistic
rs.Find ("tno = '" & TXTTNO.Text & "'") If rs.EOF = True Then rs.AddNew Else If MsgBox("Record Exist ! Overwrite?", vbYesNo + vbQuestion) = vbNo Then Exit Sub End If
If TXTTNO.Text <> "" Then rs.Fields("tno") = TXTTNO.Text Else rs.Fields("tno") = 0 rs.Fields("tdate") = txtdate.Value If txttname.Text <> "" Then rs.Fields("TName") = txttname.Text Else rs.Fields("TName") = "" If txtcname.Text <> "" Then rs.Fields("Tcourse") = txtcname.Text Else rs.Fields("tcname") = "" If txttopic.Text <> "" Then rs.Fields("ttopic") = txttopic.Text Else rs.Fields("ttopic") = "" If txtfedby.Text <> "" Then rs.Fields("Tfedby") = txtfedby.Text Else rs.Fields("Tfedby") = ""
If TXTOLE1.SourceDoc <> "" Then rs.Fields("txtole1") = TXTOLE1.SourceDoc Else rs.Fields("txtole1") = "" If txtOLE2.SourceDoc <> "" Then rs.Fields("txtole2") = txtOLE2.SourceDoc Else rs.Fields("txtole2") = ""
If txtOLE3.SourceDoc <> "" Then rs.Fields("txtole3") = txtOLE3.SourceDoc Else rs.Fields("txtole3") = "" If txtOLE4.SourceDoc <> "" Then rs.Fields("txtole4") = txtOLE4.SourceDoc Else rs.Fields("txtole4") = "" If txtOLE5.SourceDoc <> "" Then rs.Fields("txtole5") = txtOLE5.SourceDoc Else rs.Fields("txtole5") = "" If txtOLE6.SourceDoc <> "" Then rs.Fields("txtole6") = txtOLE6.SourceDoc Else rs.Fields("txtole6") = "" rs.Update MsgBox "Record is Saved!" Call ClearTextBox End Sub
Private Sub cmdsave_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsave.BackColor = &HFF8080 End Sub
Private Sub editgrid_DblClick() Dim rs1 As ADODB.Recordset Set rs1 = New ADODB.Recordset
rs1.CursorLocation = adUseClient rs1.Open "select * from MaterialMGT where [Tno] = " & Val(editgrid.Columns(0)) & " ORDER BY TNO", con, adOpenDynamic, adLockOptimistic
If rs1.RecordCount > 0 Then If rs1.BOF = False Then rs1.MoveFirst If rs1.Fields("Tno") <> "" Then TXTTNO.Text = rs1.Fields("Tno") Else TxtSno.Text = 0 If rs1.Fields("Tdate") <> "" Then txtdate.Value = rs1.Fields("tdate") If rs1.Fields("TName") <> "" Then txttname.Text = rs1.Fields("TName") Else txttname.Text = "" If rs1.Fields("Tcourse") <> "" Then txtcname.Text = rs1.Fields("Tcourse") Else txtcname.Text = "" If rs1.Fields("Ttopic") <> "" Then txttopic.Text = rs1.Fields("Ttopic") Else txttopic.Text = "" If rs1.Fields("Tfedby") <> "" Then txtfedby.Text = rs1.Fields("Tfedby") Else txtfedby.Text = ""
NewFile1 = rs1.Fields("txtole1") TXTOLE1.SourceDoc = NewFile1 TXTOLE1.CreateEmbed TXTOLE1.SourceDoc Else NewFile1 = "" TXTOLE1.SourceDoc = ""
End If
NewFile1 = rs1.Fields("txtole2") txtOLE2.SourceDoc = NewFile1 txtOLE2.CreateEmbed txtOLE2.SourceDoc Else NewFile1 = "" txtOLE2.SourceDoc = "" End If
NewFile1 = rs1.Fields("txtole3") txtOLE3.SourceDoc = NewFile1 txtOLE3.CreateEmbed txtOLE3.SourceDoc Else NewFile1 = "" txtOLE3.SourceDoc = "" End If
NewFile1 = rs1.Fields("txtole4") txtOLE4.SourceDoc = NewFile1 txtOLE4.CreateEmbed txtOLE4.SourceDoc Else NewFile1 = "" txtOLE4.SourceDoc = "" End If
NewFile1 = rs1.Fields("txtole5") txtOLE5.SourceDoc = NewFile1 txtOLE5.CreateEmbed txtOLE5.SourceDoc Else NewFile1 = "" txtOLE5.SourceDoc = "" End If
NewFile1 = rs1.Fields("txtole6") txtOLE6.SourceDoc = NewFile1 txtOLE6.CreateEmbed txtOLE6.SourceDoc Else NewFile1 = "" txtOLE6.SourceDoc = "" End If
'If rs1.Fields("ole2") <> "" Then txtOLE2.SourceDoc = rs1.Fields("ole2") Else txtOLE2.SourceDoc = "" 'If rs1.Fields("ole3") <> "" Then txtOLE3.SourceDoc = rs1.Fields("ole3") Else txtOLE3.SourceDoc = "" 'If rs1.Fields("ole4") <> "" Then txtOLE4.SourceDoc = rs1.Fields("ole4") Else txtOLE4.SourceDoc = "" 'If rs1.Fields("ole5") <> "" Then txtOLE5.SourceDoc = rs1.Fields("ole5") Else txtOLE5.SourceDoc = "" 'If rs1.Fields("ole6") <> "" Then txtOLE6.SourceDoc = rs1.Fields("ole6") Else txtOLE6.SourceDoc = "" rs1.MoveNext frmeditgrid.Visible = False
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct TNO from transche order by tnO ", con, adOpenDynamic, adLockOptimistic TXTTNO.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then TXTTNO.AddItem rs.Fields(0) rs.MoveNext Loop
rs.Open "Select distinct Trainername from transche", con, adOpenDynamic, adLockOptimistic txttname.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txttname.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.Open "Select distinct cname from transche", con, adOpenDynamic, adLockOptimistic txtcname.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtcname.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.Open "Select distinct topicname from transche", con, adOpenDynamic, adLockOptimistic txttopic.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txttopic.AddItem rs.Fields(0) rs.MoveNext Loop
rs.CursorLocation = adUseClient rs.Open "Select distinct CNAME from CATEGORY where ucase(ctype) = 'FEDBY' order by CNAME ", con, adOpenDynamic, adLockOptimistic txtfedby.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtfedby.AddItem rs.Fields(0) rs.MoveNext Loop End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsave.BackColor = &HFFC0C0 cmdedit.BackColor = &HFFC0C0 cmddel.BackColor = &HFFC0C0 cmdprint.BackColor = &HFFC0C0 cmdexit.BackColor = &HFFC0C0 End Sub
Private Sub Frame2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsave.BackColor = &HFFC0C0 cmdedit.BackColor = &HFFC0C0 cmddel.BackColor = &HFFC0C0
Private Sub Frame3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsave.BackColor = &HFFC0C0 cmdedit.BackColor = &HFFC0C0 cmddel.BackColor = &HFFC0C0 cmdprint.BackColor = &HFFC0C0 cmdexit.BackColor = &HFFC0C0 End Sub
cmdedit.BackColor = &HFFC0C0 cmddel.BackColor = &HFFC0C0 cmdprint.BackColor = &HFFC0C0 cmdexit.BackColor = &HFFC0C0 End Sub
cmdsave.BackColor = &HFFC0C0 cmdedit.BackColor = &HFFC0C0 cmddel.BackColor = &HFFC0C0 cmdprint.BackColor = &HFFC0C0 cmdexit.BackColor = &HFFC0C0 End Sub
Private Sub srchdate_Change() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from training where [tDate] = cdate('" & srchdate.Value & "')", trancon, adOpenDynamic, adLockOptimistic Set editgrid.DataSource = rs
End Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from training where feedby = '" & srchfedby.Text & "'", trancon, adOpenDynamic, adLockOptimistic Set editgrid.DataSource = rs End Sub
Private Sub txtautogen_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{TAB}" End Sub
Private Sub txtcname_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtdate_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{TAB}" End Sub
Private Sub txtfedby_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtfedby_LostFocus() Dim a As Integer a=0 If txtfedby.Text <> "" Then For i = 0 To txtfedby.ListCount - 1 If txtfedby.Text = txtfedby.List(i) Then a=1 Exit For End If Next i
If a = 0 Then MsgBox "Please Select From List Only !!", vbInformation txtfedby.Text = "" txtfedby.SetFocus Exit Sub End If End If End Sub
Private Sub txtheadng_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE1_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic1" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 TXTOLE1.SourceDoc = Modtran.hemant1 TXTOLE1.CreateEmbed TXTOLE1.SourceDoc End If End Sub
Private Sub txtOLE1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE2_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text
If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic2" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE2.SourceDoc = Modtran.hemant1 txtOLE2.CreateEmbed txtOLE2.SourceDoc End If End Sub
Private Sub txtOLE2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE3_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If
Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic3" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE3.SourceDoc = Modtran.hemant1 txtOLE3.CreateEmbed txtOLE3.SourceDoc End If End Sub
Private Sub txtOLE3_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE4_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic4" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE4.SourceDoc = Modtran.hemant1 txtOLE4.CreateEmbed txtOLE4.SourceDoc
Private Sub txtOLE4_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE5_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic5" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE5.SourceDoc = Modtran.hemant1 txtOLE5.CreateEmbed txtOLE5.SourceDoc End If End Sub
Private Sub txtOLE5_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE6_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic6" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE6.SourceDoc = Modtran.hemant1 txtOLE6.CreateEmbed txtOLE6.SourceDoc End If End Sub
Private Sub txtOLE6_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Sub ClearTextBox() Dim pcont As Control For Each pcont In Me.Controls If TypeOf pcont Is TextBox Or TypeOf pcont Is ComboBox Then pcont.Text = "" TXTOLE1.SourceDoc = "" txtOLE2.SourceDoc = "" txtOLE3.SourceDoc = "" txtOLE4.SourceDoc = "" txtOLE5.SourceDoc = "" txtOLE6.SourceDoc = "" txtdate.Value = Date Next End Sub 'Public Sub setgrid() 'With showinfogrid ' ' .Columns(0).Width = 500 ' .Columns(1).Width = 1200 ' .Columns(1).Caption = "Sr.No" ' .Columns(2).Width = 1400 ' .Columns(2).Caption = "Date" ' .Columns(3).Width = 1400 ' .Columns(3).Caption = "Software Name" ' .Columns(4).Width = 1400 ' .Columns(4).Caption = "Description"
' .Columns(5).Width = 1200 ' .Columns(5).Caption = "Heading" ' .Columns(6).Width = 1000 ' .Columns(6).Caption = "Details" ' .Columns(7).Width = 900 ' .Columns(7).Caption = "Remarks" ' .Columns(8).Width = 1200 ' .Columns(8).Caption = "Feed by" ' .Columns(9).Width = 1000 ' .Columns(9).Caption = "IMAGE-1" ' .Columns(10).Width = 1000 ' .Columns(10).Caption = "IMAGE-2" ' .Columns(11).Width = 1000 ' .Columns(11).Caption = "IMAGE-3" ' .Columns(12).Width = 1000 ' .Columns(12).Caption = "IMAGE-4" ' .Columns(13).Width = 1000 ' .Columns(13).Caption = "IMAGE-5" ' .Columns(14).Width = 1000 ' .Columns(14).Caption = "IMAGE-6" ' 'End With 'End Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from training where ucase(Heading) like '" & UCase(txtsrchding.Text) & "%'", trancon, adOpkenDynamic, adLockOptimistic Set editgrid.DataSource = rs End Sub
Private Sub txtsrchding_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then editgrid_DblClick End If
If KeyCode = vbKeyDown Then If editgrid.ApproxCount > 0 Then gridsearch.SetFocus End If End Sub
Private Sub txtsrchswnm_Change() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from training where ucase(softwareName) like '" & UCase(txtsrchswnm.Text) & "%'", trancon, adOpkenDynamic, adLockOptimistic Set editgrid.DataSource = rs End Sub
If KeyCode = vbKeyDown Then If editgrid.ApproxCount > 0 Then gridsearch.SetFocus End If End Sub
Private Sub txttname_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub TXTTNO_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub txttopic_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End SubDim NewFile1 As String Dim rs As ADODB.Recordset Dim rs1 As ADODB.Recordset Dim RSPRN As ADODB.Recordset
End Sub
Private Sub cmdadd_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdadd.BackColor = &HFF8080 End Sub
Private Sub cmddel_Click() If MsgBox("Are You Sure You Want to Delete Record", vbYesNo) = vbNo Then Exit Sub Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "delete from MaterialMGT where tno=" & Val(TXTTNO.Text), con, adOpenDynamic, adLockOptimistic MsgBox "Record is Deleted!", vbOKOnly
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from MaterialMGT", con, adOpenDynamic, adLockOptimistic Set editgrid.DataSource = rs Call ClearTextBox End Sub
Private Sub cmddel_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmddel.BackColor = &HFF8080 End Sub
Private Sub cmdedit_Click() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "SELECT * FROM MaterialMGT order by tno desc", con, adOpenDynamic, adLockOptimistic Set editgrid.DataSource = rs frmeditgrid.Visible = True frmeditgrid.ZOrder End Sub
Private Sub cmdedit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdedit.BackColor = &HFF8080 End Sub
Private Sub cmdexit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdexit.BackColor = &HFF8080 End Sub
Private Sub cmdfeddel_Click() If txtfedby.Text <> "" Then If MsgBox("Are U Sure U want to Delete?", vbInformation + vbYesNo) = vbNo Then Exit Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from MaterialMGT where ucase(tFedby)='" & UCase(txtfedby.Text) & "'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then MsgBox "Transacted Data Can`t be Deleted!", vbInformation txtfedby.SetFocus Exit Sub End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "delete from Category where ucase(ctype)='FEDBY' AND ucase(CNAME) = '" & UCase(txtfedby.Text) & "'", con, adOpenDynamic, adLockOptimistic
rs.Open "Select distinct Cname from Category where ucase(ctype) = 'FEDBY' order by cname ", con, adOpenDynamic, adLockOptimistic txtfedby.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtfedby.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from CATEGORY where ucase(ctype)='FEDBY' AND UCASE(CNAME) = '" & UCase(txtfedupdt.Text) & "' ", con, adOpenDynamic, adLockOptimistic If rs.RecordCount = 0 Then rs.AddNew
rs.Update End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct CNAME from CATEGORY where ucase(ctype) = 'FEDBY' order by CNAME ", con, adOpenDynamic, adLockOptimistic txtfedby.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtfedby.AddItem rs.Fields(0) rs.MoveNext Loop
'Private Sub cmdprint_Click() 'Dim Report As New DES_TRAINING 'Report.DiscardSavedData ' 'Set RSPRN = New ADODB.Recordset 'RSPRN.CursorLocation = adUseClient 'RSPRN.Open "DELETE FROM temptraining", trancon, adOpenDynamic, adLockOptimistic ' 'Set RSPRN = New ADODB.Recordset
'RSPRN.CursorLocation = adUseClient 'RSPRN.Open "SELECT * FROM temptraining", trancon, adOpenDynamic, adLockOptimistic ' 'Set rs = New ADODB.Recordset 'rs.CursorLocation = adUseClient 'rs.Open "SELECT * FROM training where [sno]= " & txtautogen.Text & "", trancon, adOpenDynamic, adLockOptimistic ' 'Do While Not rs.EOF ' RSPRN.AddNew ' ' ' For i = 0 To rs.Fields.Count - 1 RSPRN.Fields(i) = rs.Fields(i) Next i
' RSPRN.Update 'rs.MoveNext 'Loop ' 'Set RSPRN = New ADODB.Recordset 'RSPRN.CursorLocation = adUseClient 'RSPRN.Open "SELECT * FROM temptraining", trancon, adOpenDynamic, adLockOptimistic 'Report.Database.SetDataSource RSPRN ' ' 'Report.PrinterSetup (0) 'TRAcrviewerFRM.CRViewer1.ReportSource = Report 'TRAcrviewerFRM.CRViewer1.ViewReport
Private Sub cmdprint_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdprint.BackColor = &HFF8080 End Sub
Private Sub cmdsave_Click() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from MaterialMGT", con, adOpenDynamic, adLockOptimistic
rs.Find ("tno = '" & TXTTNO.Text & "'") If rs.EOF = True Then rs.AddNew Else If MsgBox("Record Exist ! Overwrite?", vbYesNo + vbQuestion) = vbNo Then Exit Sub End If
If TXTTNO.Text <> "" Then rs.Fields("tno") = TXTTNO.Text Else rs.Fields("tno") = 0 rs.Fields("tdate") = txtdate.Value If txttname.Text <> "" Then rs.Fields("TName") = txttname.Text Else rs.Fields("TName") = ""
If txtcname.Text <> "" Then rs.Fields("Tcourse") = txtcname.Text Else rs.Fields("tcname") = "" If txttopic.Text <> "" Then rs.Fields("ttopic") = txttopic.Text Else rs.Fields("ttopic") = "" If txtfedby.Text <> "" Then rs.Fields("Tfedby") = txtfedby.Text Else rs.Fields("Tfedby") = ""
If TXTOLE1.SourceDoc <> "" Then rs.Fields("txtole1") = TXTOLE1.SourceDoc Else rs.Fields("txtole1") = "" If txtOLE2.SourceDoc <> "" Then rs.Fields("txtole2") = txtOLE2.SourceDoc Else rs.Fields("txtole2") = "" If txtOLE3.SourceDoc <> "" Then rs.Fields("txtole3") = txtOLE3.SourceDoc Else rs.Fields("txtole3") = "" If txtOLE4.SourceDoc <> "" Then rs.Fields("txtole4") = txtOLE4.SourceDoc Else rs.Fields("txtole4") = "" If txtOLE5.SourceDoc <> "" Then rs.Fields("txtole5") = txtOLE5.SourceDoc Else rs.Fields("txtole5") = "" If txtOLE6.SourceDoc <> "" Then rs.Fields("txtole6") = txtOLE6.SourceDoc Else rs.Fields("txtole6") = "" rs.Update MsgBox "Record is Saved!" Call ClearTextBox End Sub
Private Sub cmdsave_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsave.BackColor = &HFF8080 End Sub
Private Sub editgrid_DblClick() Dim rs1 As ADODB.Recordset Set rs1 = New ADODB.Recordset rs1.CursorLocation = adUseClient rs1.Open "select * from MaterialMGT where [Tno] = " & Val(editgrid.Columns(0)) & " ORDER BY TNO", con, adOpenDynamic, adLockOptimistic
If rs1.RecordCount > 0 Then If rs1.BOF = False Then rs1.MoveFirst If rs1.Fields("Tno") <> "" Then TXTTNO.Text = rs1.Fields("Tno") Else TxtSno.Text = 0 If rs1.Fields("Tdate") <> "" Then txtdate.Value = rs1.Fields("tdate") If rs1.Fields("TName") <> "" Then txttname.Text = rs1.Fields("TName") Else txttname.Text = "" If rs1.Fields("Tcourse") <> "" Then txtcname.Text = rs1.Fields("Tcourse") Else txtcname.Text = "" If rs1.Fields("Ttopic") <> "" Then txttopic.Text = rs1.Fields("Ttopic") Else txttopic.Text = "" If rs1.Fields("Tfedby") <> "" Then txtfedby.Text = rs1.Fields("Tfedby") Else txtfedby.Text = ""
TXTOLE1.SourceDoc = ""
End If
NewFile1 = rs1.Fields("txtole2") txtOLE2.SourceDoc = NewFile1 txtOLE2.CreateEmbed txtOLE2.SourceDoc Else NewFile1 = "" txtOLE2.SourceDoc = "" End If
NewFile1 = rs1.Fields("txtole4") txtOLE4.SourceDoc = NewFile1 txtOLE4.CreateEmbed txtOLE4.SourceDoc Else NewFile1 = "" txtOLE4.SourceDoc = "" End If
NewFile1 = rs1.Fields("txtole5") txtOLE5.SourceDoc = NewFile1 txtOLE5.CreateEmbed txtOLE5.SourceDoc Else NewFile1 = "" txtOLE5.SourceDoc = ""
End If
NewFile1 = rs1.Fields("txtole6") txtOLE6.SourceDoc = NewFile1 txtOLE6.CreateEmbed txtOLE6.SourceDoc Else NewFile1 = "" txtOLE6.SourceDoc = "" End If
'If rs1.Fields("ole2") <> "" Then txtOLE2.SourceDoc = rs1.Fields("ole2") Else txtOLE2.SourceDoc = "" 'If rs1.Fields("ole3") <> "" Then txtOLE3.SourceDoc = rs1.Fields("ole3") Else txtOLE3.SourceDoc = "" 'If rs1.Fields("ole4") <> "" Then txtOLE4.SourceDoc = rs1.Fields("ole4") Else txtOLE4.SourceDoc = "" 'If rs1.Fields("ole5") <> "" Then txtOLE5.SourceDoc = rs1.Fields("ole5") Else txtOLE5.SourceDoc = "" 'If rs1.Fields("ole6") <> "" Then txtOLE6.SourceDoc = rs1.Fields("ole6") Else txtOLE6.SourceDoc = "" rs1.MoveNext frmeditgrid.Visible = False
End If
End Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct TNO from transche order by tnO ", con, adOpenDynamic, adLockOptimistic TXTTNO.clear
Do While Not rs.EOF If rs.Fields(0) <> "" Then TXTTNO.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.Open "Select distinct Trainername from transche", con, adOpenDynamic, adLockOptimistic txttname.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txttname.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.Open "Select distinct cname from transche", con, adOpenDynamic, adLockOptimistic txtcname.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtcname.AddItem rs.Fields(0) rs.MoveNext Loop
Set rs = New ADODB.Recordset rs.Open "Select distinct topicname from transche", con, adOpenDynamic, adLockOptimistic txttopic.clear Do While Not rs.EOF
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct CNAME from CATEGORY where ucase(ctype) = 'FEDBY' order by CNAME ", con, adOpenDynamic, adLockOptimistic txtfedby.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then txtfedby.AddItem rs.Fields(0) rs.MoveNext Loop End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsave.BackColor = &HFFC0C0 cmdedit.BackColor = &HFFC0C0 cmddel.BackColor = &HFFC0C0 cmdprint.BackColor = &HFFC0C0 cmdexit.BackColor = &HFFC0C0
End Sub
Private Sub Frame2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsave.BackColor = &HFFC0C0 cmdedit.BackColor = &HFFC0C0 cmddel.BackColor = &HFFC0C0 cmdprint.BackColor = &HFFC0C0 cmdexit.BackColor = &HFFC0C0 End Sub
Private Sub Frame3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsave.BackColor = &HFFC0C0 cmdedit.BackColor = &HFFC0C0 cmddel.BackColor = &HFFC0C0 cmdprint.BackColor = &HFFC0C0 cmdexit.BackColor = &HFFC0C0 End Sub
cmdsave.BackColor = &HFFC0C0 cmdedit.BackColor = &HFFC0C0 cmddel.BackColor = &HFFC0C0 cmdprint.BackColor = &HFFC0C0 cmdexit.BackColor = &HFFC0C0 End Sub
Private Sub srchdate_Change() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from training where [tDate] = cdate('" & srchdate.Value & "')", trancon, adOpenDynamic, adLockOptimistic
Set editgrid.DataSource = rs
End Sub
Private Sub srchfedby_Click() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from training where feedby = '" & srchfedby.Text & "'", trancon, adOpenDynamic, adLockOptimistic Set editgrid.DataSource = rs End Sub
Private Sub txtautogen_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{TAB}" End Sub
Private Sub txtcname_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtdate_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{TAB}"
End Sub
Private Sub txtfedby_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtfedby_LostFocus() Dim a As Integer a=0 If txtfedby.Text <> "" Then For i = 0 To txtfedby.ListCount - 1 If txtfedby.Text = txtfedby.List(i) Then a=1 Exit For End If Next i
If a = 0 Then MsgBox "Please Select From List Only !!", vbInformation txtfedby.Text = "" txtfedby.SetFocus Exit Sub End If End If
End Sub
Private Sub txtheadng_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE1_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic1" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 TXTOLE1.SourceDoc = Modtran.hemant1 TXTOLE1.CreateEmbed TXTOLE1.SourceDoc End If End Sub
Private Sub txtOLE1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE2_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic2" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE2.SourceDoc = Modtran.hemant1 txtOLE2.CreateEmbed txtOLE2.SourceDoc End If End Sub
Private Sub txtOLE2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic3" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE3.SourceDoc = Modtran.hemant1 txtOLE3.CreateEmbed txtOLE3.SourceDoc End If End Sub
Private Sub txtOLE3_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE4_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp
End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic4" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE4.SourceDoc = Modtran.hemant1 txtOLE4.CreateEmbed txtOLE4.SourceDoc End If End Sub
Private Sub txtOLE4_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE5_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic5" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE5.SourceDoc = Modtran.hemant1
Private Sub txtOLE5_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub txtOLE6_DblClick() CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then temp = Left(frmMaterial.txttname.Text, 10) & "_" & frmMaterial.TXTTNO.Text If Dir(Modtran.PhotoPath & temp) = "" Then On Error Resume Next MkDir Modtran.PhotoPath & temp End If Modtran.hemant1 = Modtran.PhotoPath & temp & "\" & temp & "_pic6" & Right(CommonDialog1.FileName, 4) FileCopy CommonDialog1.FileName, Modtran.hemant1 txtOLE6.SourceDoc = Modtran.hemant1 txtOLE6.CreateEmbed txtOLE6.SourceDoc End If End Sub
Private Sub txtOLE6_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Sub ClearTextBox() Dim pcont As Control For Each pcont In Me.Controls If TypeOf pcont Is TextBox Or TypeOf pcont Is ComboBox Then pcont.Text = "" TXTOLE1.SourceDoc = "" txtOLE2.SourceDoc = "" txtOLE3.SourceDoc = "" txtOLE4.SourceDoc = "" txtOLE5.SourceDoc = "" txtOLE6.SourceDoc = "" txtdate.Value = Date Next End Sub 'Public Sub setgrid() 'With showinfogrid ' ' .Columns(0).Width = 500 ' .Columns(1).Width = 1200 ' .Columns(1).Caption = "Sr.No"
' .Columns(2).Width = 1400 ' .Columns(2).Caption = "Date" ' .Columns(3).Width = 1400 ' .Columns(3).Caption = "Software Name" ' .Columns(4).Width = 1400 ' .Columns(4).Caption = "Description" ' .Columns(5).Width = 1200 ' .Columns(5).Caption = "Heading" ' .Columns(6).Width = 1000 ' .Columns(6).Caption = "Details" ' .Columns(7).Width = 900 ' .Columns(7).Caption = "Remarks" ' .Columns(8).Width = 1200 ' .Columns(8).Caption = "Feed by" ' .Columns(9).Width = 1000 ' .Columns(9).Caption = "IMAGE-1" ' .Columns(10).Width = 1000 ' .Columns(10).Caption = "IMAGE-2" ' .Columns(11).Width = 1000 ' .Columns(11).Caption = "IMAGE-3" ' .Columns(12).Width = 1000 ' .Columns(12).Caption = "IMAGE-4" ' .Columns(13).Width = 1000 ' .Columns(13).Caption = "IMAGE-5" ' .Columns(14).Width = 1000
Private Sub txtsrchding_Change() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from training where ucase(Heading) like '" & UCase(txtsrchding.Text) & "%'", trancon, adOpkenDynamic, adLockOptimistic Set editgrid.DataSource = rs End Sub
Private Sub txtsrchding_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then editgrid_DblClick End If
If KeyCode = vbKeyDown Then If editgrid.ApproxCount > 0 Then gridsearch.SetFocus End If End Sub
rs.Open "select * from training where ucase(softwareName) like '" & UCase(txtsrchswnm.Text) & "%'", trancon, adOpkenDynamic, adLockOptimistic Set editgrid.DataSource = rs End Sub
Private Sub txtsrchswnm_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then editgrid_DblClick End If
If KeyCode = vbKeyDown Then If editgrid.ApproxCount > 0 Then gridsearch.SetFocus End If End Sub
Private Sub txttname_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub
Private Sub TXTTNO_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}" End Sub Private Sub txttopic_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub cmbtaingno_Click() Set rs1 = New ADODB.Recordset rs1.CursorLocation = adUseClient rs1.Open "select distinct tdate from TRANSCHE where val(tno)=" & Val(cmbtaingno.Text), con, adOpenDynamic, adLockOptimistic
If rs1.Fields("tdate") <> "" Then attendate.Value = rs1.Fields("tdate") Else attendate.Value = "" End If End Sub
Set rs1 = New ADODB.Recordset rs1.CursorLocation = adUseClient rs1.Open "Select distinct Tphoto from enrollregis where val(Tenrollno)=" & Val(cmbtrano.Text), con, adOpenDynamic, adLockOptimistic
If rs1.Fields("Tphoto") <> "" Then newfilename = rs1.Fields("Tphoto") Else newfilename = "" If rs1.Fields("Tphoto") <> "" Then Image1.Picture = LoadPicture(newfilename) Else Image1.Picture = Nothing End If End If
Set rs1 = New ADODB.Recordset rs1.CursorLocation = adUseClient rs1.Open "Select distinct Tname from enrollregis where val(Tenrollno)=" & Val(cmbtrano.Text), con, adOpenDynamic, adLockOptimistic
If rs1.Fields("Tname") <> "" Then txtname.Text = rs1.Fields("tname") Else txtname.Text = "" End If End If End Sub
Private Sub cmdsubmit_Click() Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "select * from Attendance", con, adOpenDynamic, adLockOptimistic
rs.Find ("Tno = '" & cmbtrano.Text & "'") If rs.EOF = True Then rs.AddNew Else If MsgBox("Record Exist ! Overwrite?", vbYesNo + vbQuestion) = vbNo Then Exit Sub End If
If cmbtrano.Text <> "" Then rs.Fields("Tno") = cmbtrano.Text Else rs.Fields("Tno") = "" If cmbtaingno.Text <> "" Then rs.Fields("Traingno") = cmbtaingno.Text Else rs.Fields("Traingno") = "" rs.Fields("tdate") = attendate.Value
If txtname <> "" Then rs.Fields("Tname") = txtname.Text Else rs.Fields("Tname") = "" If cmbcourse.Text <> "" Then rs.Fields("Cname") = txtadd1.Text Else rs.Fields("Cname") = "" If txtadd2.Text <> "" Then rs.Fields("Tadd2") = txtadd2.Text Else rs.Fields("Tadd2") = ""
End Sub
Private Sub cmdsubmit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsubmit.BackColor = &HFF8080 End Sub
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Tenrollno from enrollregis", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbtrano.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbtrano.AddItem rs.Fields(0) rs.MoveNext Loop End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct cname from CATEGORY where ucase(ctype) = 'COURSE'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then
cmbcourse.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbcourse.AddItem rs.Fields(0) rs.MoveNext Loop End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct cname from CATEGORY where ucase(ctype) = 'TOPIC'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbtopic.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbtopic.AddItem rs.Fields(0) rs.MoveNext Loop End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Tno from TRANSCHE'", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbtaingno.clear
Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbtaingno.AddItem rs.Fields(0) rs.MoveNext Loop End If
End Sub
Private Sub frmattendnce_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) cmdsubmit.BackColor = &HFFC0C0
End Sub
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Tno from TRANSCHE", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbtrainno.clear
Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbtrainno.AddItem rs.Fields(0) rs.MoveNext Loop End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Trainername from TRANSCHE", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbtrnername.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbtrnername.AddItem rs.Fields(0) rs.MoveNext Loop End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct cname from TRANSCHE", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbcourse.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbcourse.AddItem rs.Fields(0) rs.MoveNext
Loop End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Topicname from TRANSCHE", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbtopic.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbtopic.AddItem rs.Fields(0) rs.MoveNext Loop End If
Set rs = New ADODB.Recordset rs.CursorLocation = adUseClient rs.Open "Select distinct Tname from enrollregis", con, adOpenDynamic, adLockOptimistic If rs.RecordCount > 0 Then cmbfeedby.clear Do While Not rs.EOF If rs.Fields(0) <> "" Then cmbfeedby.AddItem rs.Fields(0) rs.MoveNext Loop End If End Sub