Sunteți pe pagina 1din 68

Project Report On

BACHELOR IN COMPUTER
APPLICATIONS {B.C.A.}

Session :- 2008

Under Direction: Submitted


By:
Mr. Aditya Pathak 1. Ashish
kumar
2.
Chandrabhan kushwaha
3.
Raghvendra singh parmar
Under Guidence:
Mr. Manish Kumar Kaushal

-1-
MAKHAN LAL CHATURVEDI RASHTRIYA
PATRAKARITA VISHWAVIDYALAY BHOPAL

Project Work Evaluation

1. Candidate’s Roll
No………………..Name………………………….
2. Project title…………………………………………
3. Software base………………………
4. Sponsoring Institute Address……………………………..
5. Submitted for Course & Year……………………………………..
6. Study Centre Code, Name,
Address………………………………….
7. Total Internal assessment and exam work
evaluation………………...
Marks out of 200.
Details of evaluation along with name and sign of
teacher……………
…………………………………………………………………
……….
Particulars Mark out of Marks Awarded Internal Examiner’s
Name & Signature

8. Forwarding by head of study


centre……………………………………

(Signature, Name & Study Centre Seal)


………………………………….

9. Remarks of Study
Centre………………………………………………
…………………………………………………………………
………
10. University project Examiner’s Evaluation
Total marks awarded…………….Out of 450

-2-
Details of Evaluation along with name & sign of university
examiner.

Particulars Mark out of Marks Awarded Internal Examiner’s


Name & Signature

11. Remarks of University


Examiner………………………………………...

Acknowledgement

We are pleased to acknowledgement our indebt ness to Aditya


Pathak Director of Brain Computer College & Mr. Manish Kumar
Kaushal guided who guided and reviewed the entire project and
manuscript their most gracious, encouragement and very valued
constructive criticism are most sincerely appreciated.

We are also grateful to Aditya Pathak Director of Brain Computer


College, who gave us their kind co-operation throughout this project.

We also thanks to our class-mats for their helps. Ultimately


thanking to all their merciful cooperation and anticipation.

Author
Ashish & Chandrabhan & Raghvendra

Date :-

-3-
Place :-Brain Computer College Chhatarpur (M.P.)

-4-
Guide Certificate

Guide Name & Designation:


Manish Kumar Kaushal
Center Manager
Address:
Behind Brain Computer College
Chhatarpur(M.P.)

Certificate

This is to certify that this project entitled “ lic


management system ” submitted in partial fulfillment
of the degree of B.C.A. to the Makhanlal
Chuturvedi Rastriya Patrakarita
Vishwavidhyalay,Bhopal through “Brain Computer
College” done by student group is an authentic work
carried out by him their at “Brain Computer College ,
Chhatarpur” under my guidance. The matter
embodied in this project work has not been submitted
earlier for award of any diploma to the best of my
knowledge and belief.

Signature of Student
Signature of Guide

1. Ashish
2. Chandrabhan
3 Raghvendra

-5-
CENTER CERTIFICATE

This is to certify that the project


report entitled “lic management system”
being submitted by
“Ashish,Chandrabhan,Raghvendra In
partial fulfillment of requirement for
the award of the “B.C.A.” is record Of
their own work carried under our
guidence and supervision.

Aditya Pathak
Director

-6-
SELF CERTIFICATE

This is to certify that the dissertation /


project report entitled “LIC POLICY/PREMIUM
MANAGEMENT” is done by me is an authentic
work carried out for the partial fulfillment of the
requirements for the award of the degree of bachelor
of computer application under the guidance of
Manish kaushal . The matter embodied in this
project work has not been submitted earlier for award
of any degree or diploma to the best of my
knowledge and belief.

Signature
of the student
 Ashish.

-7-
 Chandrabhan
 Raghvendra
Roll no………………..
Brain
Computer College
Chhatarpur (m.p.)

Objective of Project: -
We are surviving in the modern era of computers
and information technology. In present, every
field is affected with computers, where there is,
need to interchange and manage the information.
However, in today’s information age there is a
need to manage information effectively.
Computer satisfies this demand and the market
abounds with numerous software, which claims to
be highly effective and offer various add on

-8-
facilities. All fields are going to be automated in
present. It enhances the working style of the
organization. The main goal of this automated
software is to perform the routine work and
manage the information Of LIC.

If we say about any LIC


office where the whole working performs manually then we
see that the Lic Agents registered manually on the paper
form. Lic agent has to offer many workers too full-fill the
requirements of the customer. LIC manager has to search the
records to aware about the detail of any customers as what is
the category of the customer. How much policy is there?
Which item is in under policy and which is in over
premium? Which managed premium on cash? In policy,
which has on premium? To whom it has managed on
premium and as well as they have to manage the policy and
premium .

If these all works perform manually, so it spends more, more


cost and more time. There is a need to create and maintain
paper records also. It means we have to face miscellaneous
problems working with manually on these types of activities.

We can reduce these types of problems by creating an


automated system, which performs this type of task with
different machine in place of paper pencil. There is a need to
create an application package to perform different activities
on computational machines. We should divide this software
in many categories and every category performs the
particulars task and the group of these categories is called
complete software.

To take notice on these problems I am going to create


software, which is related with different activities, going on
in many policy of computerized premium display. The
fundamental objective of this software to perform routine
work and to perform a different activity which gives in
different fields Lic policy so this software provided on in

-9-
different Lic policy/premium management in easy way. “Lic
policy Management all competition premium is software that
strives to meet a number of goals. Centre manager may
handle different activities related to Centre, in a proper way.
They may sustain information about the items available in
centre, detail of a customer and agents. They may fill the
detail of customer in electronic documents, create the policy
and premium memos, monitors the stock time to time,
monitors the sales, profit and loss as well as they may
achieve the information about the extra expenditures with
help of this software. This software is able to store backup of
different records and information. Lic Management
represents a fully automated premium, which provides better
services to the centre manager as well as to the customer and
Agents.

This software includes following features which increases


its importance.

Easy to use: -

This software is easy and simple to use. You may select the
field according to your interest and you may access or store
the information of particular content.

Fast accessing: -

If you want to get information of any particular field


manually, so it is very time consuming process. By using
this software, you should access information according to
your need, immediately.

- 10 -
Accuracy: -

By using this software obviously, you will


get the accurate information of any
particular field.
Interactive User Interface: -

When user will operate this software, his/her complete


attraction will focus on the software. They should select an
option according to their requirement.

- 11 -
System Requirement Analysis

In this stage of Water Fall Model the required


information gathered and analyzed by the analyst, because
information that is analyzing will focus on developing
software. In this stage system requirement and software
requirement are documented. And it is again analyzed by the
customer together this function, behavior, performance and
interface are also documented.

Design

Design process is used to translate the requirement of


software into software representation. That can be assessed
for quality before coding design. This process is use to
describe data structure, software architecture, interface
representation, algorithm etc. in this stage we develop flow
chart, pseudo codes, decision tree, table.

Flow chart
The pictorial representation of the algorithms is
called flow charts. There are many types of the boxes used in
to the flow charts. Every boxes have own different
meanings. Flow chart shows flow of the programming
For writing algorithm for solving the problems, we
take help of flowcharts. A flowchart is nothing but the
diagrammatic representation of the various steps involve in
the solving the problem. The flowchart is a step by step
diagrammatic representation of the logics path contained
within a solution to given problem. Flowcharts are drawn up
as a pictorial guide for assisting in writing of an algorithm.
The flowchart indicates the direction of the flow of a
process, relevant operations and computations, point of
decision and other information which are part of the
solution. Once developed and properly checked, the
flowchart provides an excellent guide for writing the
program.

- 12 -
- 13 -
Decision Tree
Decision tree is a old tool for showing the
alternatives actions that can result from different
combination from circumstances. The diagram resembles a
fallen tree, with the root on the left hand side and branches
representing each decision. The tree is read from left to right.
And the actions to be undertaken are recorded down. The
conditional logic of the order having process.

- 14 -
INPUT / OUTPUT SCREEN DATABASE

Database Structure

Data Base Tables

- 15 -
- 16 -
Policy Plan Table

- 17 -
Proposal Registration

- 18 -
Premium Yearly

- 19 -
Premium Half Yearly

- 20 -
Premium Quarterly

- 21 -
INPUT / OUTPUT SCREEN PROJECT

Coding:-
In this state the design of the software translate
into machine readable form. If design process is
performed in detailed manner then the coding became
very easy step.
Testing:-
When coding step is going to complete then we
starts testing of the software. The testing process focus on
structural, functional, logical and internal functioning of
the software. Testing of the software reduces the errors
from the software. And make it very clear and reliable in
its working.

 SPLASH WINDOW:-

- 22 -
 CODE SPLASH WINDOW

Option Explicit

Private Sub Form_KeyPress(KeyAscii As Integer)


Unload Me
End Sub

Private Sub Frame1_Click()


Unload Me
End Sub

Private Sub Timer1_Timer()


Label2(0).ForeColor = RGB(Rnd * 255, Rnd * 255,
Rnd * 255)

- 23 -
Label3.ForeColor = RGB(Rnd * 255, Rnd * 255,
Rnd * 255)
End Sub

Private Sub Timer2_Timer()

ProgressBar1.Visible = True
ProgressBar1.Value = ProgressBar1.Value + 1
If ProgressBar1.Value >= 100 Then
Me.Hide
frmLogin.Show
Timer2.Enabled = False
End If

End Sub

 LOGIN FORM

- 24 -
 CODE OF USER LOGIN FORM

Option Explicit

- 25 -
Public Login Succeeded As Boolean

Private Sub cmdCancel_Click()


Me.Hide
End Sub

Private Sub cmdOK_Click()


If txtPassword = "lic" Then
LoginSucceeded = True
Me.Hide
MDIForm1.Show
Else
MsgBox "Invalid Password, try
again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub

Private Sub Form_Load()

End Sub

 MDI FORM

- 26 -
 CODE OF MDI FORM

- 27 -
Private Sub abl_Click()
Me.Hide
HelpForm.Label1 = "Help About LIC"
HelpForm.HelpFile.FileName = App.Path &
"\helpfiles\helpaboutlic.txt"
HelpForm.Show

End Sub

Private Sub ama_Click()


Me.Hide
HelpForm.Label1 = "Help About MS-Access"
HelpForm.HelpFile.FileName = App.Path &
"\helpfiles\helpaboutmsaccess.txt"
HelpForm.Show

End Sub

Private Sub ap_Click()


Me.Hide
HelpForm.Label1 = "Help About PROJECT"
HelpForm.HelpFile.FileName = App.Path &
"\helpfiles\helpaboutprj.txt"
HelpForm.Show

End Sub

Private Sub avb_Click()


Me.Hide
HelpForm.Label1 = "Help About Visual Basic"
HelpForm.HelpFile.FileName = App.Path &
"\helpfiles\helpaboutvb.txt"
HelpForm.Show

- 28 -
End Sub

Private Sub hy_Click()


Me.Hide
ModeOPHalfYearly.Show

End Sub

Private Sub MDIForm_Load()

End Sub

Private Sub MNUEXIT_Click()


End
End Sub

Private Sub mnuppo_Click()


Me.Hide
ModifyDelete.Show
End Sub

Private Sub mnupr_Click()


Me.Hide
P_Reg.Show
End Sub

Private Sub qp_Click()


Me.Hide
ModeOPQuarterly.Show

End Sub
Private Sub yp_Click()
Me.Hide
YearlyPremium.Show

- 29 -
End Sub
 Half Yearly Premium Plan:-

- 30 -
 Code Half Yearly Premium Plan:-

Dim With Events adoPrimaryRS As Record


set
Dim mbChangedByCode As Boolean
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Dim mbDataChanged As Boolean

Private Sub Form_Load()


Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open
"PROVIDER=Microsoft.Jet.OLEDB.3.51;Data
Source=" & App.Path &
"\DataBase\LicDataBase.mdb"

Set adoPrimaryRS = New Record set


adoPrimaryRS.Open "select
ID,Age,Policy,Premium,Amount from SSS", db,
adOpenStatic, adLockOptimistic

Dim text As Textbox


'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next

mbDataChanged = False
End Sub

- 31 -
Private Sub Form_KeyDown(Key Code As
Integer, Shift As Integer)
If mbEditFlag Or mbAddNewFlag Then
Exit Sub

Select Case Key Code


Case vbKeyEscape
cmdClose_Click
Case vbKeyEnd
cmdlast_Click
Case vbKeyHome
cmdfirst_Click
Case vbKeyUp, vbKeyPageUp
If Shift = vbCtrlMask Then
cmdfirst_Click
Else
cmdprevious_Click
End If
Case vbKeyDown, vbKeyPageDown
If Shift = vbCtrlMask Then
cmdlast_Click
Else
cmdnext_Click
End If
End Select
End Sub

Private Sub Form Unload(Cancel As


Integer)
Screen.MousePointer = vbDefault
End Sub

- 32 -
Private Sub
adoPrimaryRS_WillChangeRecord(By Val ad
Reason As ADODB.EventReasonEnum, ByVal
cRecords As Long, adStatus As
ADODB.EventStatusEnum, ByVal pRecordset As
ADODB.Recordset)
'This is where you put validation code
'This event gets called when the following
actions occur
Dim bCancel As Boolean

Select Case ad Reason


Case adRsnAddNew
Case adRsnClose
Case adRsnDelete
Case adRsnFirstChange
Case adRsnMove
Case adRsnRequery
Case adRsnResynch
Case adRsnUndoAddNew
Case adRsnUndoDelete
Case adRsnUndoUpdate
Case adRsnUpdate
End Select

If bCancel Then adStatus = adStatusCancel


End Sub

Private Sub cmdRefresh_Click()


'This is only needed for multi user apps
On Error Go To RefreshErr
adoPrimaryRS.Requery
Exit Sub
RefreshErr:

- 33 -
MsgBox Err. Description
End Sub

Private Sub cmdClose_Click()


Unload Me
End Sub

Private Sub cmdfirst_Click()


On Error Go To GoFirstError

adoPrimaryRS.MoveFirst
mbDataChanged = False

Exit Sub

GoFirstError:
MsgBox Err.Description
End Sub

Private Sub cmdlast_Click()


On Error GoTo GoLastError

adoPrimaryRS.MoveLast
mbDataChanged = False

Exit Sub

GoLastError:
MsgBox Err.Description
End Sub

Private Sub cmdnext_Click()


On Error GoTo GoNextError

- 34 -
If Not adoPrimaryRS.EOF Then
adoPrimaryRS.MoveNext
If adoPrimaryRS.EOF And
adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveLast
End If
'show the current record
mbDataChanged = False

Exit Sub
GoNextError:
MsgBox Err.Description
End Sub

Private Sub cmdprevious_Click()


On Error GoTo GoPrevError

IfNotadoPrimaryRS.BOFThen
adoPrimaryRS.MovePrevious
If adoPrimaryRS.BOF And
adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveFirst
End If
'show the current record
mbDataChanged = False

Exit Sub

GoPrevError:
MsgBox Err.Description
End Sub

- 35 -
Private Sub SetButtons(bVal As Boolean)
cmdClose.Visible = bVal
cmdRefresh.Visible = bVal
cmdNext.Enabled = bVal
cmdFirst.Enabled = bVal
cmdLast.Enabled = bVal
cmdPrevious.Enabled = bVal
End Sub

Private Sub Timer1_Timer()


Label2.ForeColor = RGB(Rnd * 255, Rnd *
255, Rnd * 255)

End Sub

 Quarterly Premium Plan:-

- 36 -
 Code Quarterly Premium Plan:-

Dim With Events adoPrimaryRS As Record set

- 37 -
Dim mbChangedByCode As Boolean
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Dim mbDataChanged As Boolean

Private Sub Form_Load()


Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open
"PROVIDER=Microsoft.Jet.OLEDB.3.51;Data
Source=" & App.Path &
"\DataBase\LicDataBase.mdb;"

Set adoPrimaryRS = New Record set


adoPrimaryRS.Open "select
ID,Age,Policy,Amount,Premium from QLY", db,
adOpenStatic, adLockOptimistic

Dim oText As Textbox


'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next

mbDataChanged = False
End Sub

Private Sub Form_KeyDown(Key Code As


Integer, Shift As Integer)
If mbEditFlag Or mbAddNewFlag Then Exit
Sub

- 38 -
Select Case Key Code
Case vbKeyEscape
cmdClose_Click
Case vbKeyEnd
cmdlast_Click
Case vbKeyHome
cmdfirst_Click
Case vbKeyUp, vbKeyPageUp
If Shift = vbCtrlMask Then
cmdfirst_Click
Else
cmdprevious_Click
End If
Case vbKeyDown, vbKeyPageDown
If Shift = vbCtrlMask Then
cmdlast_Click
Else
cmdnext_Click
End If
End Select
End Sub

Private Sub Form Unload(Cancel As Integer)


Screen.MousePointer = vbDefault
End Sub

Private Sub
adoPrimaryRS_WillChangeRecord(ByVal ad
Reason As ADODB.EventReasonEnum, ByVal
cRecords As Long, adStatus As
ADODB.EventStatusEnum, ByVal pRecordset As
ADODB.Recordset)

- 39 -
'This is where you put validation code
'This event gets called when the following actions
occur
Dim bCancel As Boolean

Select Case ad Reason


Case adRsnAddNew
Case adRsnClose
Case adRsnDelete
Case adRsnFirstChange
Case adRsnMove
Case adRsnRequery
Case adRsnResynch
Case adRsnUndoAddNew
Case adRsnUndoDelete
Case adRsnUndoUpdate
Case adRsnUpdate
End Select

If bCancel Then adStatus = adStatusCancel


End Sub

Private Sub cmdRefresh_Click()


'This is only needed for multi user apps
On Error GoTo RefreshErr
adoPrimaryRS.Requery
Exit Sub
RefreshErr:
MsgBox Err.Description
End Sub

Private Sub cmdClose_Click()


Unload Me
End Sub

- 40 -
Private Sub cmdfirst_Click()
On Error GoTo GoFirstError

adoPrimaryRS.MoveFirst
mbDataChanged = False

Exit Sub

GoFirstError:
MsgBox Err.Description
End Sub

Private Sub cmdlast_Click()


On Error GoTo GoLastError

adoPrimaryRS.MoveLast
mbDataChanged = False

Exit Sub

GoLastError:
MsgBox Err.Description
End Sub

Private Sub cmdnext_Click()


On Error GoTo GoNextError

If Not adoPrimaryRS.EOF Then


adoPrimaryRS.MoveNext
If adoPrimaryRS.EOF And
adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveLast
End If

- 41 -
'show the current record
mbDataChanged = False

Exit Sub
GoNextError:
MsgBox Err.Description
End Sub

Private Sub cmdprevious_Click()


On Error GoTo GoPrevError

If Not adoPrimaryRS.BOF Then


adoPrimaryRS.MovePrevious
If adoPrimaryRS.BOF And
adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveFirst
End If
'show the current record
mbDataChanged = False

Exit Sub

GoPrevError:
MsgBox Err.Description
End Sub

Private Sub SetButtons(bVal As Boolean)


cmdClose.Visible = bVal
cmdRefresh.Visible = bVal
cmdNext.Enabled = bVal
cmdFirst.Enabled = bVal
cmdLast.Enabled = bVal
cmdPrevious.Enabled = bVal

- 42 -
End Sub

Private Sub Timer1_Timer()


Label2.ForeColor = RGB(Rnd * 255, Rnd * 255,
Rnd * 255)

End Sub

 Yearly Premium Plan:-

- 43 -
 Code Yearly Premium Plan:-

- 44 -
Dim With Events adoPrimaryRS As Record
set
Dim mbChangedByCode As Boolean
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Dim mbDataChanged As Boolean

Private Sub Form_Load()


Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open
"PROVIDER=Microsoft.Jet.OLEDB.3.51;Data
Source=" & App.Path &
"\DataBase\LicDataBase.mdb;"

Set adoPrimaryRS = New Record set


adoPrimaryRS.Open "select
ID,Policy,Age,Amount,Premium from YLY", db,
adOpenStatic, adLockOptimistic

Dim oText As Textbox


'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next

mbDataChanged = False
End Sub

Private Sub Form_KeyDown(Key Code As


Integer, Shift As Integer)

- 45 -
If mbEditFlag Or mbAddNewFlag Then
Exit Sub

Select Case Key Code


Case vbKeyEscape
cmdClose_Click
Case vbKeyEnd
cmdlast_Click
Case vbKeyHome
cmdfirst_Click
Case vbKeyUp, vbKeyPageUp
If Shift = vbCtrlMask Then
cmdfirst_Click
Else
cmdprevious_Click
End If
Case vbKeyDown, vbKeyPageDown
If Shift = vbCtrlMask Then
cmdlast_Click
Else
cmdnext_Click
End If
End Select
End Sub

Private Sub Form Unload(Cancel As


Integer)
Screen.MousePointer = vbDefault
End Sub

Private Sub
adoPrimaryRS_WillChangeRecord(ByVal ad
Reason As ADODB.EventReasonEnum, ByVal
cRecords As Long, adStatus As

- 46 -
ADODB.EventStatusEnum, ByVal pRecordset As
ADODB.Recordset)
'This is where you put validation code
'This event gets called when the following
actions occur
Dim bCancel As Boolean

Select Case ad Reason


Case adRsnAddNew
Case adRsnClose
Case adRsnDelete
Case adRsnFirstChange
Case adRsnMove
Case adRsnRequery
Case adRsnResynch
Case adRsnUndoAddNew
Case adRsnUndoDelete
Case adRsnUndoUpdate
Case adRsnUpdate
End Select

If bCancel Then adStatus = adStatusCancel


End Sub

Private Sub cmdAdd_Click()


On Error GoTo AddErr
With adoPrimaryRS
If Not (.BOF And .EOF) Then
mvBookMark = .Bookmark
End If
.Add New
lblStatus.Caption = "Add record"
mbAddNewFlag = True
SetButtons False
End With

- 47 -
Exit Sub
AddErr:
MsgBox Err.Description
End Sub

Private Sub cmdDelete_Click()


On Error GoTo Delete Err
With adoPrimaryRS
.Delete
.Move Next
If .EOF Then .Move Last
End With
Exit Sub
Delete Err:
MsgBox Err.Description
End Sub

Private Sub cmdRefresh_Click()


'This is only needed for multi user apps
On Error GoTo RefreshErr
adoPrimaryRS.Requery
Exit Sub
RefreshErr:
MsgBox Err.Description
End Sub

Private Sub cmdEdit_Click()


On Error GoTo EditErr

lblStatus.Caption = "Edit record"


mbEditFlag = True
SetButtons False
Exit Sub

- 48 -
EditErr:
MsgBox Err.Description
End Sub
Private Sub cmdCancel_Click()
On Error Resume Next

SetButtons True
mbEditFlag = False
mbAddNewFlag = False
adoPrimaryRS.CancelUpdate
If mvBookMark > 0 Then
adoPrimaryRS.Bookmark =
mvBookMark
Else
adoPrimaryRS.MoveFirst
End If
mbDataChanged = False

End Sub

Private Sub cmdUpdate_Click()


On Error GoTo UpdateErr

adoPrimaryRS.UpdateBatch adAffectAll

If mbAddNewFlag Then
adoPrimaryRS.MoveLast 'move to
the new record
End If

mbEditFlag = False
mbAddNewFlag = False
SetButtons True
mbDataChanged = False

- 49 -
Exit Sub
UpdateErr:
MsgBox Err.Description
End Sub

Private Sub cmdClose_Click()


Unload Me
End Sub

Private Sub cmdfirst_Click()


On Error GoTo GoFirstError

adoPrimaryRS.MoveFirst
mbDataChanged = False

Exit Sub

GoFirstError:
MsgBox Err.Description
End Sub

Private Sub cmdlast_Click()


On Error GoTo GoLastError

adoPrimaryRS.MoveLast
mbDataChanged = False

Exit Sub

GoLastError:
MsgBox Err.Description
End Sub

Private Sub cmdnext_Click()


On Error GoTo GoNextError

- 50 -
If Not adoPrimaryRS.EOF Then
adoPrimaryRS.MoveNext
If adoPrimaryRS.EOF And
adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveLast
End If
'show the current record
mbDataChanged = False

Exit Sub
GoNextError:
MsgBox Err.Description
End Sub

Private Sub cmdprevious_Click()


On Error GoTo GoPrevError

If Not adoPrimaryRS.BOF Then


adoPrimaryRS.MovePrevious
If adoPrimaryRS.BOF And
adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveFirst
End If
'show the current record
mbDataChanged = False

Exit Sub

GoPrevError:
MsgBox Err.Description

- 51 -
End Sub

Private Sub SetButtons(bVal As Boolean)


cmdAdd.Visible = bVal
cmdEdit.Visible = bVal
cmdUpdate.Visible = Not bVal
cmdCancel.Visible = Not bVal
cmdDelete.Visible = bVal
cmdClose.Visible = bVal
cmdRefresh.Visible = bVal
cmdNext.Enabled = bVal
cmdFirst.Enabled = bVal
cmdLast.Enabled = bVal
cmdPrevious.Enabled = bVal
End Sub

Private Sub Timer1_Timer()


Label1.Caption = Now
Label2.ForeColor = RGB(Rnd * 255, Rnd *
255, Rnd * 255)
End Sub

Private Sub Timer2_Timer()

Label3.Caption = Right(Label3.Caption,
Len(Label3.Caption) - 1) & Left(Label3.Caption,
1)

End Sub

- 52 -
 ProposalReg:-

- 53 -
 Code ProposalReg:-

- 54 -
Dim With Events adoPrimaryRS As Record
set
Dim mbChangedByCode As Boolean
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Dim mbDataChanged As Boolean

Private Sub cmdfirst_Click()


On Error GoTo GoFirstError
adoPrimaryRS.MoveFirst
mbDataChanged = False
Exit Sub
GoFirstError:
MsgBox Err.Description

End Sub
Private Sub cmdlast_Click()
On Error GoTo GoLastError

adoPrimaryRS.MoveLast
mbDataChanged = False

Exit Sub

GoLastError:
MsgBox Err.Description

End Sub

Private Sub cmdnext_Click()

- 55 -
On Error GoTo GoNextError

If Not adoPrimaryRS.EOF Then


adoPrimaryRS.MoveNext
If adoPrimaryRS.EOF And
adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveLast
End If
'show the current record
mbDataChanged = False

Exit Sub
GoNextError:
MsgBox Err.Description

End Sub

Private Sub cmdprevious_Click()


On Error GoTo GoPrevError

If Not adoPrimaryRS.BOF Then


adoPrimaryRS.MovePrevious
If adoPrimaryRS.BOF And
adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveFirst
End If
'show the current record
mbDataChanged = False

Exit Sub

- 56 -
GoPrevError:
MsgBox Err.Description

End Sub

Private Sub Form_Load()


Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open
"PROVIDER=Microsoft.Jet.OLEDB.4.0;dat
a source = " & App.Path &
"\database\LicDataBase.mdb;"

Set adoPrimaryRS = New Record set


adoPrimaryRS.Open "select
FormNo,Name,FName,MName,DateOfBirth
,Address,ContractNo,Sex,NameOfPlan,Age,
ModeOfPayment,Amount,DateOfInsurance,
PlanTermInYears,Nominees_Name_Address
,Division_Name,AgentName,BranchOffice
from ProposalReg", db, adOpenStatic,
adLockOptimistic

Dim oText As Textbox


'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next

mbDataChanged = False
End Sub

- 57 -
Private Sub Form_KeyDown(Key Code As
Integer, Shift As Integer)
If mbEditFlag Or mbAddNewFlag Then
Exit Sub

Select Case Key Code


Case vbKeyEscape
cmdClose_Click
Case vbKeyEnd
cmdlast_Click
Case vbKeyHome
cmdfirst_Click
Case vbKeyUp, vbKeyPageUp
If Shift = vbCtrlMask Then
cmdfirst_Click
Else
cmdprevious_Click
End If
Case vbKeyDown, vbKeyPageDown
If Shift = vbCtrlMask Then
cmdlast_Click
Else
cmdnext_Click
End If
End Select
End Sub

Private Sub Form Unload(Cancel As


Integer)
Screen.MousePointer = vbDefault

End Sub

- 58 -
Private Sub
adoPrimaryRS_WillChangeRecord(ByVal
ad Reason As ADODB.EventReasonEnum,
ByVal cRecords As Long, adStatus As
ADODB.EventStatusEnum, ByVal
pRecordset As ADODB.Recordset)
'This is where you put validation code
'This event gets called when the following
actions occur
Dim bCancel As Boolean

Select Case ad Reason

Case adRsnAddNew
Case adRsnClose
Case adRsnDelete
Case adRsnFirstChange
Case adRsnMove
Case adRsnRequery
Case adRsnResynch
Case adRsnUndoAddNew
Case adRsnUndoDelete
Case adRsnUndoUpdate
Case adRsnUpdate

End Select

If bCancel Then adStatus = adStatusCancel


End Sub

Private Sub cmdAdd_Click()


On Error GoTo AddErr
With adoPrimaryRS

- 59 -
If Not (.BOF And .EOF) Then
mvBookMark = .Bookmark
End If

.Add New
lblStatus.Caption = "Add record"
mbAddNewFlag = True
SetButtons False
End With

Exit Sub
AddErr:
MsgBox Err.Description
End Sub

Private Sub cmdDelete_Click()


On Error GoTo Delete Err
With adoPrimaryRS
.Delete
.Move Next
If .EOF Then .Move Last
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub

Private Sub cmdRefresh_Click()


'This is only needed for multi user apps
On Error GoTo RefreshErr
adoPrimaryRS.Requery
Exit Sub
RefreshErr:

MsgBox Err.Description

- 60 -
End Sub

Private Sub cmdEdit_Click()


On Error GoTo EditErr

lblStatus.Caption = "Edit record"


mbEditFlag = True
SetButtons False
Exit Sub

EditErr:

MsgBox Err.Description

End Sub

Private Sub cmdCancel_Click()


On Error Resume Next

SetButtons True
mbEditFlag = False
mbAddNewFlag = False
adoPrimaryRS.CancelUpdate
If mvBookMark > 0 Then
adoPrimaryRS.Bookmark =
mvBookMark
Else
adoPrimaryRS.MoveFirst
End If
mbDataChanged = False

End Sub

Private Sub cmdUpdate_Click()

- 61 -
On Error GoTo UpdateErr

adoPrimaryRS.UpdateBatch adAffectAll

If mbAddNewFlag Then
adoPrimaryRS.MoveLast 'move to
the new record
End If

mbEditFlag = False
mbAddNewFlag = False
SetButtons True
mbDataChanged = False

Exit Sub
UpdateErr:
MsgBox Err.Description
End Sub

Private Sub cmdClose_Click()


Unload Me
End Sub

Private Sub SetButtons(bVal As Boolean)


cmdAdd.Visible = bVal
cmdEdit.Visible = bVal
cmdUpdate.Visible = Not bVal
cmdCancel.Visible = Not bVal
cmdDelete.Visible = bVal
cmdClose.Visible = bVal
cmdRefresh.Visible = bVal
cmdnext.Enabled = bVal
cmdfirst.Enabled = bVal
cmdlast.Enabled = bVal

- 62 -
cmdprevious.Enabled = bVal
End Sub

 Proposal Registration:-

- 63 -
- 64 -
 Code Proposal Registration:-

Dim Con As New ADODB.Connection


Dim Rs As New ADODB.Recordset
Dim Mstr As String
Dim I As Integer

Private Sub Command1_Click()


Rs.Close
Rs.Open "Select * from ProposalReg", Con,
adOpenDynamic, adLockOptimistic

If Val(Text7.Text) < 14 Or Val(Text7.Text) >


63 Then
MsgBox "Sorry!, You are not authorized
person for this policy.....", vbInformation
Exit Sub
Else
AddPolicyRecord
MsgBox "The policy details has been
successfully added", vbInformation

End If

End Sub

Private Sub Form_Load()

- 65 -
Con.Provider =
"Microsoft.Jet.OLEDB.3.51;Data Source="
& App.Path &
"\DataBase\LicDataBase.mdb;"
Con.Open
Mstr = "select distinct (policy) from
policyplan"

Rs.Open Mstr, Con, adOpenDynamic,


adLockOptimistic

While Not Rs.EOF


Combo1.AddItem Rs.Fields(0)
Rs.MoveNext
Wend

Set Rs = Con.Execute("select distinct


(modeofpayment) from policyplan")
While Not Rs.EOF
Combo2.AddItem Rs.Fields(0)
Rs.MoveNext
Wend

Text10.Text = Date

End Sub

Private Sub Form Unload(Cancel As


Integer)
Con.Close

End Sub

- 66 -
Private Sub Text4_LostFocus()
Dim D1 As Date
Dim D2 As Date
Dim DDiff As Integer
D1 = Text4.Text
D2 = Date
DDiff = (D2 - D1) / 365

Text7.Text = DDiff

End Sub

Private Sub Timer1_Timer()


Label18(1).ForeColor = RGB(Rnd * 255,
Rnd * 255, Rnd * 255)
Label18(2).Caption = Time

End Sub

Sub AddPolicyRecord()

Rs.AddNew
Rs.Fields(1) = Text1.Text
Rs.Fields(2) = Text2.Text
Rs.Fields(3) = Text3.Text
Rs.Fields(4) = Text4.Text
Rs.Fields(5) = text13.Text
Rs.Fields(6) = Text5.Text
Rs.Fields(7) = Combo3.Text
Rs.Fields(8) = Combo1.Text
Rs.Fields(9) = Text7.Text
Rs.Fields(10) = Combo2.Text
Rs.Fields(11) = Text8.Text
Rs.Fields(12) = Text10.Text
Rs.Fields(13) = Text11.Text

- 67 -
Rs.Fields(14) = Text12.Text
Rs.Fields(15) = text14.Text
Rs.Fields(16) = Text15.Text
Rs.Fields(17) = Text16.Text
Rs.Update

End Sub

- 68 -

S-ar putea să vă placă și