• No results found

This is the opening screen of the package, user has to click Ok to move forward or close the package.

Code:

Private Sub Command1_Click () frmpassword.Show

Me.Hide End Sub

Login Form:

It ask user to enter the User name & Password, if he enter it correctly access is granted else he is given three chances to enter the correct Username & Password, if he fail then system is shutdown.

Code:

Private Sub Command1_Click() If Text2 = "" Then

MsgBox " Please enter the Password " Password_Text.SetFocus

Exit Sub End If

If flag < 3 Then

If Text2 = "deepak" Then MDIForm1.Show

frmpassword.Hide Else

MsgBox ("Incorrect Password") flag = flag + 1

End If Else

MsgBox (" Intruder Detected ") End

End If

End Sub

Private Sub Command2_Click() End

End Sub

Private Sub Form_Load() Dim flag As Integer Text1 = "Administrator" Text1.Locked = True flag = 1

End Sub

MDI Form:

This is first form after the access is granted to the user, it shows the menus that are available to the user.

Code:

Option Explicit

'Public db As Database 'Public ws As Workspace Private Sub MDIForm_Load()

Set ws = DBEngine.Workspaces(0)

Set db = ws.OpenDatabase(App.Path & "\shiv.mdb") End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button) Select Case Button.key

Case "New" frmnewadmission.Show Case "Edit" frmstuedit.Show Case "Fee" Fee.Show Case "Del" frmRecDel.Show Case "Reprint" frmprint.Show

41

Case "Details" frmDetails.Show Case "Cash" frmcash.Show Case "FeeS" frmFStatus.Show Case "close" End End Select End Sub

42

Few Screen Shots:

New Admission form

Edit form

Fee detail

Student Detail Report

Fee detail report

Conveyance Detail Report

Security Detail Report

Fee Status report

Coding:

New Admission-

Option Explicit

Dim cl As Recordset 'used for class table Dim stdnt As Recordset 'used for student table Dim match As Recordset

Dim i, j, k As Integer Public key As Boolean 'Public editkey As Boolean Dim a, b As String

Private Sub Chkcon_Click() If chkcon.value = 1 Then txtfrom.Enabled = True txtfrom.SetFocus Else txtfrom.Enabled = False txtfrom.Text = "" End If End Sub

Private Sub cmdclear_Click() clear 'call clear procedure End Sub

Private Sub cmdclose_Click() If key = True Then

stdnt.CancelUpdate key = False

End If

stdnt.Close 'close the student table recordset Unload Me

End Sub

'Private Sub Cmdedit_Click() 'enable

'If newkey = True Then ' newkey = False 'End If

'editkey = True 'txtadmnno.SetFocus 'End Sub

Private Sub cmdnew_Click()

If key = True Then Exit Sub Else stdnt.AddNew key = True Txtadmnno.SetFocus End If End Sub

Private Sub cmdok_Click() If key = True Then

If Txtadmnno.Text = "" Or txtdoa.Text = "" Or txtsname.Text = "" Or _

txtdob.Text = "" Or txtfname.Text = "" Or txtaddr.Text = "" Or cboclass.Text = "" Or _

txtsec.Text = "" Or txtrollno.Text = "" Then

i = MsgBox("ENTER PROPER DETAILS", vbOKOnly, "STUDENT") Exit Sub

End If

i = Format(txtdoa.Text, "yyyy") j = Format(txtdob.Text, "yyyy") If i <= j Then

k = MsgBox("Date of Birth can't be greater than or equal to Date of Admission", vbOKOnly, "STUDENT DETAILS")

txtdob.SetFocus Exit Sub

End If

If chkcon.value = 1 And txtfrom.Text = "" Then

i = MsgBox("PLEASE ENTER THE LOCATION", vbOKOnly, "STUDENT DETAILS") txtfrom.SetFocus

Exit Sub End If

If txtsecurity.Text = "" Then txtsecurity.Text = 0 If txtannch.Text = "" Then txtannch.Text = 0 a = Right(Txtadmnno.Text, 1)

If a = "S" And Not (cboclass.Text = "TWELFTH" Or cboclass.Text = "ELEVENTH") Then

i = MsgBox("CLASS NOT COMPATIBLE WITH THE ADMISSION NUMBER.", vbOKOnly, "NEW ADMISSION")

cboclass.SetFocus Exit Sub

ElseIf a = "H" And Not (cboclass.Text = "TENTH" Or cboclass.Text = "NINTH") Then

i = MsgBox("CLASS NOT COMPATIBLE WITH THE ADMISSION NUMBER.", vbOKOnly, "NEW ADMISSION")

cboclass.SetFocus Exit Sub

ElseIf a = "M" And Not (cboclass.Text = "SIXTH" Or cboclass.Text = "SEVENTH" Or cboclass.Text = "EIGHTH") Then

i = MsgBox("CLASS NOT COMPATIBLE WITH THE ADMISSION NUMBER.", vbOKOnly, "NEW ADMISSION")

cboclass.SetFocus Exit Sub

ElseIf a = "P" And Not (cboclass.Text = "FIRST" Or cboclass.Text = "SECOND" Or cboclass.Text = "THIRD" Or cboclass.Text = "FOURTH" Or cboclass.Text = "FIFTH") Then

i = MsgBox("CLASS NOT COMPATIBLE WITH THE ADMISSION NUMBER.", vbOKOnly, "NEW ADMISSION")

cboclass.SetFocus Exit Sub

ElseIf a = "L" And Not (cboclass.Text = "NURSERY" Or cboclass.Text = "LKG") Then

i = MsgBox("CLASS NOT COMPATIBLE WITH THE ADMISSION NUMBER.", vbOKOnly, "NEW ADMISSION")

cboclass.SetFocus Exit Sub

End If

b = "select * from student where admnno = '" & Txtadmnno.Text & "';" Set match = db.OpenRecordset(b, dbReadOnly)

If match.RecordCount >= 1 Then

i = MsgBox("THIS ADMISSION NUMBER ALREADY EXISTS. CAN'T INSERT TWO RECORDS WITH SAME ADMISSION NUMBER.", vbOKOnly, "NEW

ADMISSION")

Txtadmnno.SetFocus Exit Sub

End If match.Close

b = "select * from student where rollno = " & txtrollno.Text & " and class = '" & cboclass.Text & "' and sec = '" & txtsec.Text & "';"

Set match = db.OpenRecordset(b, dbReadOnly) If match.RecordCount >= 1 Then

i = MsgBox("THIS ROLL NUMBER ALREADY EXIST. INSERT ANOTHER.", vbOKOnly, "NEW ADMISSION")

txtrollno.SetFocus Exit Sub End If commit stdnt.Update key = False clear End If

'ElseIf editkey = True Then ' txtadmnno.Enabled = True

' If Txtdoa.Text = "" Or txtsname.Text = "" Or _

' Txtdob.Text = "" Or txtfname.Text = "" Or Txtaddr.Text = "" Or Cboclass.Text = "" Or _

' txtsec.Text = "" Or txtrollno.Text = "" Then

' i = MsgBox("ENTER PROPER DETAILS", vbOKOnly, "STUDENT") ' Exit Sub

' End If

' i = Format(Txtdoa.Text, "yyyy") ' j = Format(Txtdob.Text, "yyyy") ' If i <= j Then

' k = MsgBox("Date of Birth can't be greater than or equal to Date of Admission", vbOKOnly, "STUDENT DETAILS")

' Txtdob.SetFocus ' Exit Sub

' End If

' If Chkcon.value = 1 And Txtfrom.Text = "" Then

' i = MsgBox("PLEASE ENTER THE LOCATION", vbOKOnly, "STUDENT DETAILS")

' Txtfrom.SetFocus ' Exit Sub

' End If

' If txtsecurity.Text = "" Then txtsecurity.Text = 0 ' stdnt.Edit ' commit ' stdnt.Update ' editkey = False ' clear ' disable 'Else ' Exit Sub End Sub

Private Sub Form_Load() Me.Top = 0

Me.Left = 0

clas ' Load the combo box with the class names

Set stdnt = db.OpenRecordset("student", dbOpenDynaset) stdnt.AddNew

key = True

txtfrom.Enabled = False End Sub

Public Sub clas()

Set cl = db.OpenRecordset("class", dbReadOnly) cl.MoveLast i = cl.RecordCount cl.MoveFirst For j = 1 To i cboclass.AddItem cl!class cl.MoveNext Next cl.Close End Sub

Private Sub commit()

stdnt!Admnno = Txtadmnno.Text

stdnt!doa = Format(txtdoa.Text, "dd/mm/yyyy") stdnt!sname = txtsname.Text

stdnt!dob = Format(txtdob.Text, "dd/mm/yyyy") stdnt!fname = txtfname.Text stdnt!Addr = txtaddr.Text stdnt!class = cboclass.Text stdnt!sec = txtsec.Text stdnt!rollno = txtrollno.Text stdnt!security = txtsecurity.Text stdnt!Conv = chkcon.value stdnt!Loc = txtfrom.Text stdnt!annch = txtannch.Text End Sub

Private Sub clear() Txtadmnno.Text = "" txtdoa.Text = ""

txtsname.Text = "" txtdob.Text = "" txtfname.Text = "" txtaddr.Text = "" cboclass.Text = "" txtsec.Text = "" txtrollno.Text = "" txtsecurity.Text = "" chkcon.value = False txtfrom.Text = "" txtannch.Text = "" End Sub

Private Sub Txtaddr_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii)))

End Sub

Private Sub Txtadmnno_KeyPress(KeyAscii As Integer) Dim str As String

str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" KeyAscii = Asc(UCase(Chr(KeyAscii)))

If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub txtannch_KeyPress(KeyAscii As Integer) Dim str As String

str = "0123456789" If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

'Private Sub txtadmnno_LostFocus() 'If editkey = True Then

' If Not (txtadmnno.Text = "") Then ' finddata

' End If 'End If 'End Sub

Private Sub Txtdoa_KeyPress(KeyAscii As Integer) Dim str As String

str = "0123456789/" If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub Txtdoa_LostFocus() Dim chk As Variant

If Not (txtdoa.Text = "") Then chk = txtdoa.Text

If Not (IsDate(chk)) Then

i = MsgBox("ENTER CORRECT DATE", vbOKOnly, "NEW ADMISSION") txtdoa.SetFocus

End If End If End Sub

Private Sub Txtdob_KeyPress(KeyAscii As Integer) Dim str As String

str = "0123456789/" If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub Txtdob_LostFocus() Dim chk As Variant

If Not (txtdob.Text = "") Then chk = txtdob.Text

If Not (IsDate(chk)) Then

i = MsgBox("ENTER CORRECT DATE", vbOKOnly, "NEW ADMISSION") txtdob.SetFocus

End If End If End Sub

Private Sub txtfname_KeyPress(KeyAscii As Integer) Dim str As String

str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ " KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub Txtfrom_KeyPress(KeyAscii As Integer) Dim str As String

str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ, " KeyAscii = Asc(UCase(Chr(KeyAscii)))

If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub txtrollno_KeyPress(KeyAscii As Integer)

Dim str As String str = "0123456789" If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub txtsec_KeyPress(KeyAscii As Integer) Dim str As String

str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub txtsecurity_KeyPress(KeyAscii As Integer) Dim str As String

str = "0123456789" If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub txtsname_KeyPress(KeyAscii As Integer) Dim str As String

str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ " KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

'Private Sub disable() 'txtadmnno.Enabled = False 'Txtdoa.Enabled = False 'txtsname.Enabled = False 'Txtdob.Enabled = False 'txtfname.Enabled = False 'txtsecurity.Enabled = False 'Txtaddr.Enabled = False 'Cboclass.Enabled = False 'txtsec.Enabled = False 'txtrollno.Enabled = False 'Chkcon.Enabled = False 'Txtfrom.Enabled = False 'End Sub

57

'Private Sub enable() 'txtadmnno.Enabled = True 'Txtdoa.Enabled = True 'txtsname.Enabled = True 'Txtdob.Enabled = True 'txtfname.Enabled = True 'txtsecurity.Enabled = True 'Txtaddr.Enabled = True 'Cboclass.Enabled = True 'txtsec.Enabled = True 'txtrollno.Enabled = True 'Chkcon.Enabled = True 'Txtfrom.Enabled = True 'End Sub

'Private Sub finddata()

'a = "select * from student where admnno = '" & txtadmnno.Text & "';" 'Set match = db.OpenRecordset(a, dbOpenDynaset)

'If match.RecordCount < 1 Then

' i = MsgBox("RECORD NOT FOUND", vbOKOnly, "NEW ADMISSION") 'Else

' link 'End If 'End Sub

'Private Sub link()

'Txtdoa.Text = match!doa 'txtsname.Text = match!sname 'Txtdob.Text = match!dob 'txtfname.Text = match!fname 'txtsecurity.Text = match!security 'Txtaddr.Text = match!addr 'Cboclass.Text = match!class 'txtsec.Text = match!sec 'txtrollno.Text = match!rollno 'Chkcon.value = match!conv 'Txtfrom.Text = match!Loc 'End Sub

Edit student Details:

Option Explicit

Dim stdnt As Recordset ' recordset used for student table Dim cla As Recordset ' recordset used for class table

Dim match As Recordset ' used to match the admnno in the student table

Dim str As String Dim sql As String Dim r As Variant Dim i, j, k As Integer Dim key As Boolean Dim chk As Boolean

Private Sub Chkcon_Click() If chkcon.value = 0 Then txtfrom.Text = ""

txtfrom.Enabled = False ElseIf chkcon.value = 1 Then txtfrom.Enabled = True txtfrom.SetFocus End If

End Sub

Private Sub cmdclose_Click() If key = True Then

stdnt.Close key = False End If

Unload Me End Sub

Private Sub cmddelete_Click()

If Txtadmnno.Text = "" Or cboclass.Text = "" Or txtsec.Text = "" Or _ txtsname.Text = "" Or txtfname.Text = "" Or txtdoa.Text = "" Or _ txtdob.Text = "" Or txtaddr.Text = "" Or txtrollno.Text = "" Then Exit Sub

Else

r = MsgBox("ARE YOU SURE YOU WANT TO DELETE THIS RECORD.", vbYesNoCancel, "DELETE RECORD")

If r = vbYes Then stdnt.Edit stdnt.Delete clear Else Exit Sub End If End If cmdsave.Enabled = False cmddelete.Enabled = False End Sub

Private Sub cmdfirst_Click() If cmdnext.Enabled = False Then cmdnext.Enabled = True End If cmdprevious.Enabled = False stdnt.MoveFirst link End Sub

Private Sub cmdlast_Click()

If cmdprevious.Enabled = False Then cmdprevious.Enabled = True End If cmdnext.Enabled = False stdnt.MoveLast link End Sub

59

Private Sub cmdnext_Click()

If cmdprevious.Enabled = False Then cmdprevious.Enabled = True End If stdnt.MoveNext If stdnt.EOF Then stdnt.MoveLast cmdnext.Enabled = False End If link End Sub

Private Sub cmdprevious_Click() If cmdnext.Enabled = False Then cmdnext.Enabled = True End If stdnt.MovePrevious If stdnt.BOF Then stdnt.MoveFirst cmdprevious.Enabled = False End If link End Sub

Private Sub cmdsave_Click()

If chkcon.value = 1 And txtfrom.Text = "" Then

i = MsgBox("PLEASE ENTER THE LOCATION", vbOKOnly, "STUDENT DETAILS") txtfrom.SetFocus Exit Sub End If stdnt.Edit commit stdnt.Update clear cmdsave.Enabled = False movefalse End Sub

Private Sub cmdsearch_Click() If Not (Txtadmnno.Text = "") Then

str = "select * from student where admnno = '" & Txtadmnno.Text & "';" movefalse

ElseIf Not (cboclass.Text = "") And Not (txtsec.Text = "") Then

str = "select * from student where class = '" & cboclass.Text & "' and sec = '" & txtsec.Text & "' order by rollno;"

movetrue chk = True Else

i = MsgBox("ENTER PROPER DETAILS.", vbOKOnly, "STUDENT INFORMATION")

Exit Sub End If clear

Set stdnt = db.OpenRecordset(str, dbOpenDynaset) key = True

If stdnt.RecordCount < 1 Then

i = MsgBox("RECORD NOT FOUND", vbOKOnly, "STUDENT INFORMATION") clear optclass.value = False optstudent.value = False Exit Sub End If link cboclass.Enabled = True txtsec.Enabled = True Txtadmnno.Enabled = False cmdsave.Enabled = True cmddelete.Enabled = True If chk = True Then lblrec.Visible = True lblrecfound.Visible = True lblrec.Caption = stdnt.RecordCount End If End Sub

Private Sub Optclass_Click() clear cboclass.Enabled = True txtsec.Enabled = True Txtadmnno.Enabled = False cboclass.SetFocus End Sub

Private Sub Optstudent_Click() clear Txtadmnno.Enabled = True cboclass.Enabled = False txtsec.Enabled = False Txtadmnno.SetFocus End Sub

Private Sub class()

Set cla = db.OpenRecordset("class", dbReadOnly) cla.MoveLast i = cla.RecordCount cla.MoveFirst For j = 1 To i cboclass.AddItem cla!class cla.MoveNext Next cla.Close End Sub

Private Sub Form_Load() Me.Top = 0

Me.Left = 0 class

optstudent.Enabled = True

optclass.Enabled = True Txtadmnno.Enabled = False cboclass.Enabled = False txtsec.Enabled = False cmdsave.Enabled = False cmddelete.Enabled = False lblrec.Visible = False lblrecfound.Visible = False movefalse End Sub

Private Sub Txtaddr_KeyPress(KeyAscii As Integer) str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ, " KeyAscii = Asc(UCase(Chr(KeyAscii)))

If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub Txtadmnno_KeyPress(KeyAscii As Integer) str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" KeyAscii = Asc(UCase(Chr(KeyAscii)))

If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub Txtdoa_KeyPress(KeyAscii As Integer) str = "0123456789/"

KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub Txtdob_KeyPress(KeyAscii As Integer) str = "0123456789/"

KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub txtfname_KeyPress(KeyAscii As Integer) str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ "

KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub Txtfrom_KeyPress(KeyAscii As Integer) str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ, " KeyAscii = Asc(UCase(Chr(KeyAscii)))

If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub txtrollno_KeyPress(KeyAscii As Integer) str = "0123456789"

KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub txtsec_KeyPress(KeyAscii As Integer) str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub link()

Txtadmnno.Text = stdnt!Admnno txtsname.Text = stdnt!sname

txtdoa.Text = Format(stdnt!doa, "dd/mm/yyyy") txtfname.Text = stdnt!fname

txtdob.Text = Format(stdnt!dob, "dd/mm/yyyy") txtaddr.Text = stdnt!Addr txtrollno.Text = stdnt!rollno txtsec.Text = stdnt!sec cboclass.Text = stdnt!class txtsecurity.Text = stdnt!security txtannch.Text = stdnt!annch If stdnt!concession = True Then chkconcession = 1

Else

chkconcession = 0 End If

If stdnt!Conv = True Then chkcon = 1

txtfrom.Text = stdnt!Loc Else chkcon = 0 txtfrom.Text = "" End If End Sub

Private Sub txtsecurity_KeyPress(KeyAscii As Integer) str = "0123456789"

KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub txtsname_KeyPress(KeyAscii As Integer) str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ "

KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

Private Sub clear() Txtadmnno.Text = "" cboclass.Text = "" txtsec.Text = "" txtsname.Text = "" txtfname.Text = "" txtdoa.Text = "" txtdob.Text = "" txtsecurity.Text = "" txtrollno.Text = "" txtaddr.Text = "" chkcon.value = 0 txtfrom.Text = "" txtannch.Text = "" lblrec.Visible = False lblrecfound.Visible = False chkconcession.value = 0 End Sub

Private Sub commit()

stdnt!Admnno = Txtadmnno.Text stdnt!sname = txtsname.Text

stdnt!doa = Format(txtdoa.Text, "dd/mm/yyyy") stdnt!fname = txtfname.Text

stdnt!dob = Format(txtdob.Text, "dd/mm/yyyy") stdnt!Addr = txtaddr.Text

stdnt!rollno = txtrollno.Text stdnt!sec = txtsec.Text

stdnt!class = cboclass.Text If txtsecurity.Text = "" Then stdnt!security = 0 Else stdnt!security = txtsecurity.Text End If stdnt!Conv = chkcon.value stdnt!Loc = txtfrom.Text If txtannch.Text = "" Then stdnt!annch = 0 Else stdnt!annch = txtannch.Text End If stdnt!concession = chkconcession.value End Sub

Private Sub movefalse() cmdfirst.Enabled = False cmdnext.Enabled = False cmdprevious.Enabled = False cmdlast.Enabled = False End Sub

Private Sub movetrue() cmdfirst.Enabled = True cmdnext.Enabled = True cmdprevious.Enabled = True cmdlast.Enabled = True End Sub

Student Detail Report:

Option Explicit Dim rs As Recordset Dim cla As Recordset Dim SSql As String Dim totrec As Integer Dim i As Integer

Private Sub cmdclose_Click() Unload Me

End Sub

Private Sub cmdprint_Click() If chkcon.value = 0 Then

db.Execute "SELECT * INTO [SDetail] FROM Student where Class = '" & cboclass.Text & "' and Sec='" & txtsec.Text & "' order by rollno;"

ElseIf chkcon.value = 1 Then

db.Execute "SELECT * INTO [SDetail] FROM Student where Class = '" & cboclass.Text & "' and Sec='" & txtsec.Text & "' and conv = True order by rollno;"

End If

Dim PrintResponse As String

MDIForm1.CrystalReport1.Destination = crptToWindow MDIForm1.CrystalReport1.CopiesToPrinter = 1

PrintResponse = MsgBox("Press [YES] to print report on PRINTER, [NO] to view on SCREEN, [CANCEL] to abort ", vbYesNoCancel)

If PrintResponse = vbYes Then

MDIForm1.CrystalReport1.Destination = crptToPrinter ElseIf PrintResponse = vbNo Then

MDIForm1.CrystalReport1.Destination = crptToWindow Else

Exit Sub End If

With MDIForm1.CrystalReport1

.ReportFileName = App.Path + "\stulist.rpt"

.SelectionFormula = "{student.class} = '" & Trim(cboclass) & "' and {student.sec} = '" & Trim(txtsec) & "'"

.Formulas(0) = "" .Formulas(1) = ""

.WindowState = crptMaximized .Action = 1

End With

On Error Resume Next

db.Execute "drop table SDetail" End Sub

Private Sub cmdsearch_Click()

If Not (cboclass.Text = "" And txtsec.Text = "") And chkcon.value = 0 Then SSql = "Select * from Student where Class = '" & cboclass.Text & "' and Sec = '" & txtsec.Text & "' order by rollno;"

ElseIf Not (cboclass.Text = "" And txtsec.Text = "") And chkcon.value = 1 Then SSql = "select * from Student where class = '" & cboclass.Text & "' and sec = '" & txtsec.Text & "' and conv = true order by rollno;"

Else

i = MsgBox("ENTER PROPER DETAILS", vbOKOnly, "DETAILS") Exit Sub

End If

Set rs = db.OpenRecordset(SSql, dbOpenDynaset) If rs.RecordCount > 0 Then rs.MoveLast totrec = rs.RecordCount msfDetail.Rows = totrec + 1 rs.MoveFirst For i = 1 To totrec With msfDetail .TextMatrix(i, 0) = rs!Admnno .TextMatrix(i, 1) = rs!sname .TextMatrix(i, 2) = rs!fname

.TextMatrix(i, 3) = Format(rs!doa, "dd/mm/yyyy") .TextMatrix(i, 4) = Format(rs!dob, "dd/mm/yyyy") .TextMatrix(i, 5) = rs!security .TextMatrix(i, 6) = rs!Addr .TextMatrix(i, 7) = rs!class .TextMatrix(i, 8) = rs!sec .TextMatrix(i, 9) = rs!rollno .TextMatrix(i, 10) = rs!Conv If Not (rs!Loc = "") Then .TextMatrix(i, 11) = rs!Loc Else

.TextMatrix(i, 11) = ""

End If End With rs.MoveNext Next End If End Sub

Private Sub Form_Load() Me.Top = 0

Me.Left = 0 class

End Sub

Private Sub class()

Set cla = db.OpenRecordset("class", dbReadOnly) cla.MoveLast totrec = cla.RecordCount cla.MoveFirst For i = 1 To totrec cboclass.AddItem cla!class cla.MoveNext Next cla.Close End Sub

Private Sub txtsec_KeyPress(KeyAscii As Integer) Dim str As String

str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii > 26 Then

If InStr(str, Chr(KeyAscii)) = 0 Then KeyAscii = 0

End If End If End Sub

IMPLEMENTATION STRATEGIES

A crucial phase in the system life cycle of the successful implementation of the new system design. Implementation simply means conveying a new system design into operation. This involves creating computer-compatible files, training the operating staff and installing hardware, terminals and telecommunication networks before the system is up and running. A critical factor in conversion is not disrupting the functioning of the organization.

In system implementation, user training is crucial for minimizing resistance to change and giving the new system a chance to prove its worth. Training aids, such as user friendly, manuals, a data dictionary, job performance aids that communicate information about the new system and “help” screens provide the user with a good start on the new system.

There are three types of implementation:

1. Implementation of a computer system to replace a manual system: The problems encounter are converting files, training users, creating accurate files and verifying printouts for integrity.

2. Implementing of a new computer system to replace an existing one: This is usually a difficult conversion. If not properly planned there can be many problems. Some large computer system has taken as long as a year to convert.

3. Implementation of a modified application to replace an existing one using the

same computer:

This type of conversion is relatively easy to handle, provided there are no major changes in the files.

Conversion means changing from one system to another. The objective is to put the tested system into operation while holding costs, risks, and personnel irritation to a

Related documents