Sie sind auf Seite 1von 79

FAST BANKING SERVICE

EMPLOYEE LOGIN WINDOW

FAST BANKING SERVICE

HOMESCREEN WINDOW

FAST BANKING SERVICE

SIGNATURE VERIFICATION WINDOW

FAST BANKING SERVICE

ACCOUNT RELATED OPERATIONS SCREEN

FAST BANKING SERVICE

ABOUT VISUAL BASIC


INTRODUCTION
Visual Basic is not just a language. Its an Integrated Development Environment in which you can develop, run, test and debug your applications. Visual Basic comes in three editions. 1) The Visual Basic Learning edition:-it is the introductory edition that lets you easily create windows applications. It comes with all the tools you need to build mainstream windows application. 2) The Visual Basic Professional edition: - it is for computer professionals and includes advanced features such as tools to develop ActiveX and internet controls.
3)

The Visual Basic Enterprise edition: - it is the most advanced edition and is aimed at programmers who build distributed application in a team environment. It includes all the features the professional edition, plus tools such as visual SourceSafe and the automation and component manager.

FAST BANKING SERVICE

Integrated Development Environment Elements


The Visual Basic (IDE) consists of the following elements.

Menu Bar
Displays the commands you use to work with Visual Basic. Besides the standard File, Edit, View, Window, and Help menus, menus are provided to access functions specific to programming such as Project, Format, or Debug.

Context Menus
Contain shortcuts to frequently performed actions. To open a context menu, click the right mouse button on the object you're using. The specific list of shortcuts available from context menus depends on the part of the environment where you click the right mouse button. For example, the context menu displayed when you right click on the Toolbox lets you display the Components dialog box, hide the Toolbox, dock or undock the Toolbox, or add a custom tab to the Toolbox.

Toolbars
Provide quick access to commonly used commands in the programming environment. You click a button on the toolbar once to carry out the action represented by that button. By default, the Standard toolbar is displayed when you start Visual Basic. Additional toolbars for editing, form design, and debugging can be toggled on or off from the Toolbars command on the View menu. Toolbars can be docked beneath the menu bar or can "float" if you select the vertical bar on the left edge and drag it away from the menu bar.
7

FAST BANKING SERVICE

Toolbox
Provides a set of tools that you use at design time to place controls on a form. In addition to the default toolbox layout, you can create your own custom layouts by selecting Add Tab from the context menu and adding controls to the resulting tab.

Project Explorer Window


Lists the forms and modules in your current project. A project is the collection of files you use to build an application.

Properties Window
Lists the property settings for the selected form or control. A property is a characteristic of an object, such as size, caption, or color.

Object Browser
Lists objects available for use in your project and gives you a quick way to navigate through your code. You can use the Object Browser to explore objects in Visual Basic and other applications, see what methods and properties are available for those objects, and paste code procedures into your application. By using the Object Browser to view procedures, see "Finding out about Objects" in "Programming with Objects." For details on using add-ins to extend the Visual Basic programming environment, see "Using Wizards and Add-ins" in "Managing Projects."

Form Designer
Serves as a window that you customize to design the interface of your application. You add controls, graphics, and pictures to a form to create the look you want. Each form in your application has its own form designer window.

FAST BANKING SERVICE

Code Editor Window


Serves as an editor for entering application code. A separate code editor window is created for each form or code module in your application.

Form Layout Window


The Form Layout window allows you to position the forms in your application using a small graphical representation of the screen.

Immediate, Locals, and Watch Windows


These additional windows are provided for use in debugging your application. They are only available when you are running your application within the IDE. You can also add features to the Visual Basic interface by using a program called an add-in. Add-ins, which are available from Microsoft and third-party developers , can provide features like source code control, which allows you to support group development projects.

FAST BANKING SERVICE

Standard Toolbox Controls


Pointer
The only item in the Toolbox that doesn't draw a control. When you select the pointer, you can only resize or move a control that has already been drawn on a form.

PictureBox
Displays graphical images (either decorative or active), as a container that receives output from graphics methods, or as a container for other controls.

Label
Allows you to have text that you don't want the user to change, such as a caption under a graphic.

TextBox
Holds text that the user can either enter or change.

Frame
Allows you to create a graphical or functional grouping for controls. To group controls, draw the Frame first, and then draw controls inside the frame.

CommandButton
Creates a button the user can choose to carry out a command.

10

FAST BANKING SERVICE

CheckBox
Creates a box that the user can easily choose to indicate if something is true or false, or to display multiple choices when the user can choose more than one.

OptionButton
Allows you to display multiple choices from which the user can choose only one.

ComboBox
Allows you to draw a combination list box and text box. The user can either choose an item from the list or enter a value in the text box.

ListBox
Used to display a list of items from which the user can choose one. The list can be scrolled if it has more items than can be displayed at one time.

HScrollBar (horizontal scroll bar)


Provides a graphical tool for quickly navigating through a long list of items or a large amount of information, for indicating the current position on a scale, or as an input device or indicator of speed or quantity.

VScrollBar (vertical scroll bar)


Provides a graphical tool for quickly navigating through a long list of items or a large amount of information, for indicating the current position on a scale, or as an input device or indicator of speed or quantity.

11

FAST BANKING SERVICE

Timer
Generates timer events at set intervals. This control is invisible at run time.

DriveListBox
Displays valid disk drives.

DirListBox (directory list box)


Displays directories and paths.

FileListBox
Displays a list of files.

Shape
Allows you to draw a variety of shapes on your form at design time. You can choose a rectangle, rounded rectangle, square, rounded square, oval, or circle. Line Used to draw a variety of line styles on your form at design time.

Image
Displays a graphical image from a bitmap, icon, or metafile on your form. Images displayed in an Image control can only be decorative and use fewer resources than a PictureBox.

Data
Provides access to data in databases through bound controls on your form.

12

FAST BANKING SERVICE

OLE
Allows you to link and embed objects from other applications in your Visual Basic application

Variables
Were now ready to attach code to our application. As objects are added to the form, Visual Basic automatically builds a framework of all event procedures. We simply add code to the event procedures we want our application to respond to. But before we do this, we need to discuss variables. Variables are used by Visual Basic to hold information needed by your application. Rules used in naming variables: No more than 40 characters They may include letters, numbers, and underscore (_) The first character must be a letter You cannot use a reserved word (word needed by Visual Basic)

13

FAST BANKING SERVICE

Visual Basic Data Types Data Type Suffix


Boolean None Integer % Long (Integer) & Single (Floating) ! Double (Floating) # Currency @ Date None Object None String $ Variant None

Variable Declaration
There are three ways for a variable to be typed (declared): 1. Default 2. Implicit 3. Explicit If variables are not implicitly or explicitly typed, they are assigned the variant type by default. The variant data type is a special type used by Visual Basic that can contain numeric, string, or date data.

14

FAST BANKING SERVICE

The ODBC Provider


The ODBC Provider maps OLE DB interfaces to ODBC APIs. With the ODBC Provider, OLE DB consumers can connect to a database server through the existing ODBC drivers in the following process: A consumer calls an OLE DB interface on the ODBC Provider. The ODBC Provider invokes corresponding ODBC APIs and sends the requests to an ODBC driver. Because the ODBC Provider allows OLE DB consumers to use existing ODBC drivers, there may be some performance concern about the additional layer of the ODBC Provider on top of the existing ODBC driver manager. The design goal of the ODBC Provider is to implement all the functionality of the ODBC driver manager; therefore, the ODBC driver manager is not needed. However, the ODBC Provider still requires the ODBC Driver Manager to support connection pooling with ODBC applications.

15

FAST BANKING SERVICE

ABOUT MICROSOFT ACCESS INTRODUCTION


A database is a collection of information that's related to a particular subject or purpose, such as tracking customer orders or maintaining a music collection. If your database isn't stored on a computer, or only parts of it are, you may be tracking information from a variety of sources that you're having to coordinate and organize yourself. Using Microsoft Access, you can manage all your information from a single database file. Within the file, you can use:

Tables to store your data. Queries to find and retrieve just the data you want. Forms to view, add, and update data in tables. Reports to analyze or print data in a specific layout. Data access pages to view, update, or analyze the database's data from the Internet or an intranet.

QUERIES
To find and retrieve just the data that meets conditions that you specify, including data from multiple tables, create a query. A query can also update or delete multiple records at the same time, and perform predefined or custom calculations on your data.

FORMS
To easily view, enter, and change data directly in a table, create a form. When you open a form, Microsoft Access retrieves the data from one or more tables, and displays it on the screen with the layout you choose in the Form Wizard, or with the layout that you created on your own in Design view (Design view: A window that shows the design of these database objects: tables, queries, forms, reports, macros, and data access
16

FAST BANKING SERVICE

pages. In Design view, you can create new database objects and modify the design of existing ones.). A table displays many records at the same time, but you might have to scroll to see all of the data in a single record. Also, when viewing a table, you can't update data from more than one table at the same time. A form focuses on one record at a time, and it can display fields from more than one table. It can also display pictures and other objects. A form can contain a button that prints, opens other objects, or otherwise automates tasks

REPORTS
To analyze your data or present it a certain way in print, create a report. For example, you might print one report that groups data and calculates totals, and another report with different data formatted for printing mailing labels Use a report to create mailing labels. Use a report to show totals in a chart. Use a report to calculate totals

MACROS
A macro is a set of one or more actions (action: The basic building block of a macro; a self-contained instruction that can be combined with other actions to automate tasks. This is sometimes called a command in other macro languages.) that each perform a particular operation, such as opening a form or printing a report. Macros can help you to automate
17

FAST BANKING SERVICE

common tasks. For example, you can run a macro that prints a report when a user clicks a command button.

MACRO GROUP
If you have numerous macros, grouping related macros in macro groups (macro group: A collection of related macros that are stored together under a single macro name. The collection is often referred to simply as a macro.) can help you to manage your database more easily. For example, the following macro group, named Buttons, is made up of three related macros: Employees, Products, and Reps. Each macro carries out the OpenForm action, and the Products macro also carries out the MoveSize action.

18

FAST BANKING SERVICE

19

FAST BANKING SERVICE

CODING FOR CREATING MODULE


Public con As New ADODB.Connection Public acno As Integer Public TNO As Integer Public rs As New ADODB.Recordset Public query As String Public Sub Connect() con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\bank.mdb" End Sub Public Sub Disconnect() con.Close Set con = Nothing End Sub Public Sub CloseRecordset() rs.Close Set rs = Nothing End Sub Public Sub OpenRecordset() rs.Open query, con, adOpenDynamic, adLockOptimistic End Sub

20

FAST BANKING SERVICE

CODING FOR SPLASH FORM


Option Explicit Private Sub Timer1_Timer() Form20.Show Unload Me End Sub

CODING FOR EMPLOYEE FORM


Dim g(10) As Long Dim l As Long Dim an As Integer, pa As Integer Dim cl As Integer, X As Integer, a As Integer Dim b As Integer, c As Integer Public name1 As String Public mode As Integer, chequefacility As String Private Sub Command1_Click() If emp_name.Text = "" Or emp_id.Text = "" Then MsgBox "Must enter the EMPLOYEE NAME and EMP ID ", vbOKOnly, " ERROR! Please check your Entry." emp_name.SetFocus Exit Sub End If If IsNumeric(emp_name.Text) Then MsgBox "Enter Only text.", vbOKOnly, " ERROR! Check Account number." emp_name.SetFocus SendKeys "{home}+{end}" Exit Sub End If Connect

21

FAST BANKING SERVICE

query = "select * from emp_detail where emp_names='" & emp_name.Text & "' and emp_ids=" & emp_id.Text & " " OpenRecordset If Not rs.EOF Then If UCase(rs.Fields("type")) = "TRUE" Then MsgBox "YOUR ACCOUNT HAS BEEN CLOSED", vbOKOnly + 64, "ALERT! Account Closed" CloseRecordset Disconnect emp_id.Text = "" emp_name.Text = "" Exit Sub Else CloseRecordset Disconnect emp_id.Text = "" Form1.Show End If Else MsgBox "INVALID Customer name or Account number. ", vbOKOnly, " ERROR! Check Customer & Account" emp_name.SetFocus SendKeys "{HOME}+{END}" emp_id.Text = "" CloseRecordset Disconnect Exit Sub End If End Sub Private Sub Command2_Click() MsgBox "THANKS YOU! LOGOUT SUCCESSFULLY", vbOKOnly, " LOGOUT MESSAGE."
22

FAST BANKING SERVICE

End End Sub Private Sub Form_Load() dt.Caption = Format(Date, "dd-mmm-yyyy") dy.Caption = Format(Date, "dddd") X=0 Form1.BorderStyle = 0 TM.Caption = Time g(0) = RGB(0, 255, 0) g(1) = RGB(0, 0, 255) g(2) = RGB(255, 0, 0) g(3) = RGB(128, 255, 248) g(4) = RGB(255, 120, 242) g(5) = RGB(100, 255, 241) g(6) = RGB(200, 255, 240) g(7) = RGB(160, 255, 247) g(8) = RGB(111, 112, 240) g(9) = RGB(130, 140, 160) g(10) = RGB(190, 180, 170) End Sub Private Sub Timer1_Timer() Label3.ForeColor = g(l) l=l+1 If (l = 11) Then l=0 End If End Sub Private Sub Timer2_Timer() Timer2.Interval = 50 Label5.Left = Label5.Left - 50 If Label5.Left < -50 Then Label5.Left = Screen.Width End If
23

FAST BANKING SERVICE

End Sub Private Sub Timer3_Timer() TM.Caption = Time End Sub

CODING FOR HOMESCREEN FORM


Dim g(10) As Long Dim l As Long Dim an, i As Integer, pa As Integer Dim cl As Integer, X As Integer, a As Integer Dim b As Integer, c As Integer Public acnumber As Integer Public mode As String, chequefacility As String Private Sub go_Click() If acnotext.Text = "" Or pastext.Text = "" Then MsgBox "Must enter the Customer name and Account number ", vbOKOnly, " ERROR! Please check your Entry." acnotext.SetFocus Exit Sub End If If Not IsNumeric(acnotext.Text) Then MsgBox "Enter Only 4 Digits Numeric values for Account Number.", vbOKOnly, " ERROR! Check Account number." acnotext.SetFocus SendKeys "{home}+{end}" Exit Sub End If acnumber = Val(acnotext.Text) Connect query = "select * from account_master where acholder_name='" & pastext.Text & "' and account_no=" & acnumber & " "
24

FAST BANKING SERVICE

OpenRecordset If Not rs.EOF Then If UCase(rs.Fields("closed")) = "TRUE" Then MsgBox "YOUR ACCOUNT HAS BEEN CLOSED", vbOKOnly + 64, "ALERT! Account Closed" CloseRecordset Disconnect acnotext.Text = "" pastext.Text = "" Exit Sub Else mode = rs.Fields("account_type") chequefacility = rs.Fields("cheque_facility") CloseRecordset Disconnect pastext.Text = "" Form21.Show End If Else MsgBox "INVALID Customer name or Account number. ", vbOKOnly, " ERROR! Check Customer & Account" acnotext.SetFocus SendKeys "{HOME}+{END}" pastext.Text = "" CloseRecordset Disconnect Exit Sub End If End Sub Private Sub Form_Load() dt.Caption = Format(Date, "dd-mmm-yyyy") dy.Caption = Format(Date, "dddd") X=0
25

FAST BANKING SERVICE

Form1.BorderStyle = 0 TM.Caption = Time picAccountBox.Move (ScaleWidth / 2) - (picAccountBox.Width / 2), (ScaleHeight / 2) - (picAccountBox.Height / 2) Picture2.Move (ScaleWidth / 2) - (Picture2.Width / 2) 'query = "select * from transact " 'OpenRecordset 'Do While Not rs.EOF g(0) = RGB(0, 255, 0) g(1) = RGB(0, 0, 255) g(2) = RGB(255, 0, 0) g(3) = RGB(128, 255, 248) g(4) = RGB(255, 120, 242) g(5) = RGB(100, 255, 241) g(6) = RGB(200, 255, 240) g(7) = RGB(160, 255, 247) g(8) = RGB(111, 112, 240) g(9) = RGB(130, 140, 160) g(10) = RGB(190, 180, 170) End Sub Private Sub fornewac_Click() Form2.Show (1) End Sub Private Sub Label8_Click() Form10.Show 1 End Sub Private Sub Label9_Click() Form17.Show 1 End Sub Private Sub QUIT_Click() Unload Me
26

FAST BANKING SERVICE

Form20.Show End Sub Private Sub reopen_Click() Form14.Show 1 End Sub Private Sub Timer1_Timer() TM.Caption = Time End Sub Private Sub Timer2_Timer() Label6.ForeColor = g(l) l=l+1 If (l = 11) Then l=0 End If End Sub Private Sub Timer3_Timer() Timer3.Interval = 50 Label1.Left = Label1.Left - 50 If Label1.Left < -50 Then Label1.Left = Screen.Width End If End Sub

27

FAST BANKING SERVICE

CODING FOR LIST A/C HOLDER FORM


Private Sub Command1_Click() Unload Me End Sub Private Sub Form_Load() query = "select account_no,acholder_name,address from account_master" Connect OpenRecordset Dim totalRowCount As Long totalRowCount = 0 Do While Not rs.EOF totalRowCount = totalRowCount + 1 rs.MoveNext Loop If totalRowCount > 0 Then rs.MoveFirst MSHFlexGrid1.Rows = totalRowCount MSHFlexGrid1.ColWidth(0) = 2500 MSHFlexGrid1.ColWidth(1) = 3500 MSHFlexGrid1.ColWidth(2) = 3000 End If RowCount = -1 Do While Not rs.EOF RowCount = RowCount + 1 MSHFlexGrid1.Col = 0 MSHFlexGrid1.Row = RowCount MSHFlexGrid1.Text = rs.Fields("account_no") MSHFlexGrid1.Col = 1
28

FAST BANKING SERVICE

MSHFlexGrid1.Row = RowCount MSHFlexGrid1.Text = rs.Fields("acholder_name") MSHFlexGrid1.Col = 2 MSHFlexGrid1.Row = RowCount MSHFlexGrid1.Text = rs.Fields("address") rs.MoveNext Loop CloseRecordset Disconnect End Sub

29

FAST BANKING SERVICE

CODING FOR OPENING NEW A/C FORM


Option Explicit Public m As Integer Dim sql As String Dim chefaci As String Dim actype As String Dim mode As String Dim a As Integer, an As Integer Dim wnam As String, wad As String, wacc As Integer, s As String Dim i As Integer, opamt As Currency, minbal As Currency Dim rep As Integer Private Sub cancel_Click() Timer1.Interval = 0 Timer1.Enabled = False Unload Me s="" Timer1.Enabled = False End Sub Private Sub Command1_Click() submit_Click End Sub Private Sub Command2_Click() cancel_Click End Sub Private Sub current_Click() actype = "CURRENT" End Sub Private Sub Form_Load() Timer1.Enabled = True
30

FAST BANKING SERVICE

Timer1.Interval = 500 s = "ACCOUNT OPENING SCREEN" Connect rs.Open "account_master", con, adOpenDynamic, adLockOptimistic, adCmdTable If Not rs.EOF Then rs.MoveLast a = rs.Fields(0) acno = a + 1 CloseRecordset Else acno = 1001 CloseRecordset End If jholdername.Visible = False jholderage.Visible = False joccupation.Visible = False jname.Visible = False jage.Visible = False joccup.Visible = False Shape18.Visible = False Shape19.Visible = False Shape20.Visible = False Disconnect End Sub Private Sub joint_Click() mode = "JOINT" jholdername.Visible = True jholderage.Visible = True joccupation.Visible = True jname.Visible = True jage.Visible = True joccup.Visible = True Shape18.Visible = True
31

FAST BANKING SERVICE

Shape19.Visible = True Shape20.Visible = True End Sub Private Sub Label1_Click() Form17.Show 1 End Sub Private Sub no_Click() chefaci = "NO" End Sub Private Sub savings_Click() actype = "SAVINGS" End Sub Private Sub singal_Click() mode = "SINGLE" jholdername.Visible = False jholderage.Visible = False joccupation.Visible = False jname.Visible = False jage.Visible = False joccup.Visible = False Shape18.Visible = False Shape19.Visible = False Shape20.Visible = False End Sub Private Sub submit_Click() s = "ACCOUNT OPENING SCREEN" Timer1.Enabled = True checkfields If m = 1 Then m=0
32

FAST BANKING SERVICE

Exit Sub End If opamt = Val(openingamount.Text) If actype = "SAVINGS" And chefaci = "YES" Then minbal = 1500 ElseIf actype = "SAVINGS" And chefaci = "NO" Then minbal = 1000 ElseIf actype = "CURRENT" And chefaci = "YES" Then minbal = 3000 Else minbal = 2000 End If If opamt < minbal Then rep = MsgBox("Error in opening balance amount" & vbCrLf & "Want to see the criteria ", vbYesNo + vbInformation, "Error...") If rep = vbNo Then openingamount.SetFocus SendKeys "{HOME}+{END}" Exit Sub Else MsgBox "Account Type" & Space(5) & "Cheque Facility" & Space(5) & "Minimum Balance" & Chr(13) & Chr(13) & " 1. SAVINGS" & Space(15) & "YES" & Space(20) & "1500" & Chr(13) & " 2. SAVINGS" & Space(15) & "NO" & Space(22) & "1000" & Chr(13) & " 3. CURRENT" & Space(15) & "YES" & Space(20) & "3000" & Chr(13) & " 4. CURRENT" & Space(15) & "NO" & Space(22) & "2000", vbOKOnly + vbInformation, "Minimum Balance" openingamount.SetFocus SendKeys "{HOME}+{END}" Exit Sub End If End If wnam = UCase(Text1.Text) wad = UCase(Text2.Text) wacc = Val(Text3.Text)
33

FAST BANKING SERVICE

Connect sql = "select * from account_master where acholder_name='" & wnam & "' and address='" & wad & "' and account_no=" & wacc rs.Open sql, con, adOpenDynamic, adLockOptimistic, adCmdText If rs.EOF Then MsgBox "Error occured due to these reasons" & vbCrLf & " 1. Witness name is not correct" & vbCrLf & " 2. Witness address is wrong" & vbCrLf & " 3. Witness doesnot hold any account" & vbCrLf & "Please check these things", vbInformation, "Error Occured" Text1.SetFocus CloseRecordset Exit Sub Else CloseRecordset 'inserting records into account_master table rs.Open "account_master", con, adOpenDynamic, adLockOptimistic, adCmdTable rs.AddNew rs.Fields(0) = acno rs.Fields(1) = UCase(acnametext.Text) rs.Fields(3) = Val(acagetext.Text) If mode = "SINGLE" Then rs.Fields(4) = "" rs.Fields(5) = 0 rs.Fields(7) = "" Else rs.Fields(4) = UCase(jname.Text) rs.Fields(5) = Val(jage.Text) rs.Fields(7) = UCase(joccup.Text) End If rs.Fields(6) = UCase(acocctext.Text) rs.Fields(8) = UCase(acaddtext.Text) rs.Fields(9) = Val(acphtext.Text) rs.Fields(10) = chefaci
34

FAST BANKING SERVICE

rs.Fields(11) = actype rs.Fields(12) = mode rs.Fields(13) = Date rs.Fields(14) = "FALSE" rs.Fields(15) = opamt rs.Update CloseRecordset 'inserting records into witness_details table rs.Open "witness_details", con, adOpenDynamic, adLockOptimistic, adCmdTable rs.AddNew rs.Fields(0) = acno rs.Fields(1) = UCase(Text1.Text) rs.Fields(2) = UCase(Text2.Text) rs.Fields(3) = Val(Text3.Text) rs.Update CloseRecordset End If 'inserting records into nominee_details table rs.Open "nominee_details", con, adOpenDynamic, adLockOptimistic, adCmdTable rs.AddNew rs.Fields(0) = acno rs.Fields(1) = UCase(Text4.Text) rs.Fields(2) = UCase(Text5.Text) rs.Fields(3) = UCase(Text6.Text) rs.Update CloseRecordset 'inserting records into current_details table rs.Open "current_details", con, adOpenDynamic, adLockOptimistic, adCmdTable rs.AddNew rs.Fields(0) = acno rs.Fields(1) = opamt rs.Fields(2) = Date
35

FAST BANKING SERVICE

rs.Update CloseRecordset Disconnect resettextbox Form3.Show 1 End Sub Private Sub Timer1_Timer() i=i+1 lb1.Caption = lb1.Caption & Mid(s, i, 1) If lb1.Caption = "ACCOUNT OPENING SCREEN" Then Timer1.Enabled = False End If End Sub Private Sub yes_Click() chefaci = "YES" End Sub Private Sub resettextbox() acnametext.Text = "" jname.Text = "" acagetext.Text = "" jage.Text = "" acocctext.Text = "" joccup.Text = "" acaddtext.Text = "" acphtext.Text = "" yes.Value = False no.Value = False singal.Value = False joint.Value = False savings.Value = False current.Value = False openingamount.Text = ""
36

FAST BANKING SERVICE

Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" End Sub Private Sub checkfields() If acnametext.Text = "" Then MsgBox "Enter the account holder name", , "Caution" m=1 acnametext.SetFocus Exit Sub End If If IsNumeric(acnametext.Text) Then MsgBox "Numeric value is not allowed in this field", , "Caution" acnametext.SetFocus SendKeys "{home}+{end}" m=1 acnametext.SetFocus Exit Sub End If If acagetext.Text = "" Then MsgBox "Enter your age", , "Caution" m=1 acagetext.SetFocus Exit Sub ElseIf Val(acagetext.Text) < 18 Then MsgBox "Your age must be 18 years or more", , "Invalid age" m=1 Exit Sub ElseIf Len(acagetext.Text) > 2 Then

37

FAST BANKING SERVICE

MsgBox "Enter a valid age that should be under 100 years", , "Invalid age" m=1 acagetext.SetFocus SendKeys "{home}+{end}" Exit Sub End If If Not IsNumeric(acagetext.Text) Then MsgBox "Only numeric value is allowed", , "Caution" m=1 acagetext.SetFocus Exit Sub End If If acocctext.Text = "" Then MsgBox "Give your occupation", , "Caution" acocctext.SetFocus m=1 Exit Sub ElseIf IsNumeric(acocctext.Text) Then MsgBox "Invalid entry", , "Caution" acocctext.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub End If If acaddtext.Text = "" Then MsgBox "Address must be entered", , "Caution" acaddtext.SetFocus m=1 Exit Sub ElseIf IsNumeric(acaddtext.Text) Then MsgBox "Enter string not numeric", , "Caution" acaddtext.SetFocus SendKeys "{home}+{end}" m=1
38

FAST BANKING SERVICE

Exit Sub End If If joint.Value = True Then If jname.Text = "" Then MsgBox "Enter the joint account holder name", , "Caution" jname.SetFocus m=1 Exit Sub ElseIf IsNumeric(jname.Text) Then MsgBox "Invalid entry not allowed", , "Error" jname.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub ElseIf jage.Text = "" Then MsgBox "Enter the joint account holder age", , "Caution" jage.SetFocus m=1 Exit Sub ElseIf Not IsNumeric(jage.Text) Then MsgBox "Invalid entry not allowed", , "Error" jage.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub ElseIf joccup.Text = "" Then MsgBox "Enter the joint account holder occupation", , "Caution" joccup.SetFocus m=1 Exit Sub ElseIf IsNumeric(jname.Text) Then MsgBox "Invalid entry not allowed", , "Error" joccup.SetFocus SendKeys "{home}+{end}" m=1
39

FAST BANKING SERVICE

Exit Sub End If Else Exit Sub End If End Sub

CODING FOR CONGRATULATION FORM


Private Sub Form_Load() Connect rs.Open "account_master", con, adOpenDynamic, adLockOptimistic, adCmdTable rs.MoveLast Label3.Caption = rs.Fields(0) Label4.Caption = rs.Fields(1) CloseRecordset Disconnect End Sub

Private Sub Timer1_Timer() Unload Me Form2.Visible = False End Sub

40

FAST BANKING SERVICE

CODING FOR REOPEN CLOSED A/C FORM


Dim m As Integer Private Sub activate_Click() checkfields If m = 1 Then m=0 Exit Sub End If Connect query = "select * from account_master where account_no=" & Val(Text1.Text) OpenRecordset If rs.Fields("closed") = "FALSE" Then MsgBox "UR ACCOUNT IS ALREADY OPEN", vbOKOnly + vbCritical, "SWISS BANK" CloseRecordset Disconnect Unload Me Else rs.Fields("closed") = "FALSE" rs.Fields("opening_amount") = Val(Text3.Text) rs.Update MsgBox "your account is being activated" CloseRecordset query = "select * from current_details" OpenRecordset rs.AddNew rs.Fields(0) = Val(Text1.Text) rs.Fields(1) = Val(Text3.Text) rs.Fields(2) = Date rs.Update CloseRecordset
41

FAST BANKING SERVICE

Disconnect Unload Me End If End Sub Private Sub cancel_Click() Unload Me End Sub Private Sub checkfields() If Text1.Text = "" Then MsgBox "Give your account number" Text1.SetFocus m=1 Exit Sub ElseIf Not IsNumeric(Text1.Text) Then MsgBox "enter only text" Text1.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub End If If Text3.Text = "" Then MsgBox "Deposit amount to re-open your account" Text3.SetFocus m=1 Exit Sub ElseIf Not IsNumeric(Text3.Text) Then MsgBox "This type of entry is not allowed only currency" Text3.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub ElseIf Val(Text3.Text) < 2000 Then MsgBox "Atleast 2000 opening balance"
42

FAST BANKING SERVICE

Text3.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub End If End Sub

43

FAST BANKING SERVICE

CODING FOR DAILY TRANSACTION FORM


Public transQuery As String Private Sub Command1_Click() transQuery = "select * from transact where transaction_date=#" & Date & "#" Me.Hide Form12.Show 1 End Sub Private Sub Command2_Click() transQuery = "select * from transact where transaction_date between #" & DTPicker1.Value & "# and #" & DTPicker2.Value & "#" Me.Hide Form12.Show 1 End Sub Private Sub Command3_Click() Me.Hide End Sub

44

FAST BANKING SERVICE

CODING FOR SIGNATURE VERIFICATION FORM


Private Sub Command1_Click() Form19.Show End Sub Private Sub Command2_Click() Unload Me Form1.Show End Sub Private Sub Form_Load() query = "select * from account_master where account_no=" & Form1.acnumber Connect OpenRecordset Set Picture1.Picture = _ LoadPicture(rs.Fields("signature"), vbLPLarge, vbLPColor) Label1.Caption = rs.Fields("acholder_name") CloseRecordset Disconnect End Sub

45

FAST BANKING SERVICE

CODING FOR LOADING CUSTOMER RELATED OPERATION FORM


Dim a(10) As Long Dim b As Long Private Sub Form_Load() a(0) = RGB(0, 255, 0) a(1) = RGB(0, 0, 255) a(2) = RGB(255, 0, 0) a(3) = RGB(128, 255, 248) a(4) = RGB(255, 120, 242) a(5) = RGB(100, 255, 241) a(6) = RGB(200, 255, 240) a(7) = RGB(160, 255, 247) a(8) = RGB(111, 112, 240) a(9) = RGB(130, 140, 160) a(10) = RGB(190, 180, 170) End Sub Private Sub Timer1_Timer() ProgressBar1.Value = ProgressBar1.Value + 20 If ProgressBar1.Value = 100 Then Timer1.Enabled = False Unload Form19 Form4.Show End If End Sub Private Sub Timer2_Timer() Label4.ForeColor = a(b) b=b+1 If (b = 11) Then b=0 End If End Sub
46

FAST BANKING SERVICE

CODING FOR CUSTOMER RELATED OPERATION FORM


Dim g(10) As Long Dim l As Long Public curbal As Currency Private Sub acdetails_Click() Form16.Show 1 End Sub Private Sub acdetails_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single) Shape10.Visible = False End Sub Private Sub balanceenquiry_Click() Form11.Show 1 End Sub Private Sub balanceenquiry_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single) Shape8.Visible = False End Sub Private Sub cancel_Click() Form1.Show End Sub Private Sub depbycash_Click() 'Form16.Show 1 End Sub

47

FAST BANKING SERVICE

Private Sub depbycheque_Click() Form13.Show 1 End Sub Private Sub depbycheque_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single) Shape13.Visible = False End Sub Private Sub deposit_Click() Form8.Show 1 End Sub Private Sub deposit_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single) Shape12.Visible = False End Sub Private Sub Form_Load() Connect query = "select * from account_master where account_no=" & Form1.acnumber OpenRecordset Label2.Caption = rs.Fields("acholder_name") CloseRecordset Disconnect g(0) = RGB(0, 255, 0) g(1) = RGB(0, 0, 255) g(2) = RGB(255, 0, 0) g(3) = RGB(128, 255, 248) g(4) = RGB(255, 120, 242) g(5) = RGB(100, 255, 241) g(6) = RGB(200, 255, 240) g(7) = RGB(160, 255, 247) g(8) = RGB(111, 112, 240)
48

FAST BANKING SERVICE

g(9) = RGB(130, 140, 160) g(10) = RGB(190, 180, 170) End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single) If Shape8.Visible = False Then Shape8.Visible = True If Shape9.Visible = False Then Shape9.Visible = True If Shape10.Visible = False Then Shape10.Visible = True If Shape11.Visible = False Then Shape11.Visible = True If Shape12.Visible = False Then Shape12.Visible = True If Shape13.Visible = False Then Shape13.Visible = True If Shape15.Visible = False Then Shape15.Visible = True Connect query = "select * from current_details where account_no=" & Form1.acnumber OpenRecordset CloseRecordset Disconnect End Sub Private Sub Label4_Click() rep = MsgBox("Do you want to close your account", vbYesNo + vbQuestion, "Asking for closing account") If rep = vbYes Then flag = True Connect an = Val(Form1.acnotext.Text) qur = "select * from current_details where account_no=" & an rs.Open qur, con, adOpenDynamic, adLockOptimistic, adCmdText amt = rs.Fields(1) CloseRecordset Disconnect 'MsgBox "Error occured due to these reasons" & vbCrLf & " 1. Witness name is not correct" & vbCrLf & " 2. Witness address is
49

FAST BANKING SERVICE

wrong" & vbCrLf & " 3. Witness doesnot hold any account" & vbCrLf & "Please check these things", vbInformation, "Error Occured" MsgBox "your current balance is " & amt & vbCrLf & " First withdraw your amount and your account will be closed", , "Closing Account" Unload Me Form9.Show 1 Else flag = False Exit Sub End If End Sub Private Sub others_Click() Form6.Show 1 End Sub Private Sub others_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single) Shape9.Visible = False End Sub Private Sub Timer1_Timer() Timer1.Interval = 50 Label3.Left = Label3.Left - 50 If Label3.Left < -50 Then Label3.Left = Screen.Width End If End Sub Private Sub withdrawal_Click() Connect query = "select * from current_details where account_no=" & Form1.acnumber OpenRecordset curbal = rs.Fields(1)
50

FAST BANKING SERVICE

CloseRecordset Disconnect Form9.Show 1 End Sub Private Sub withdrawal_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single) Shape11.Visible = False End Sub

51

FAST BANKING SERVICE

CODING FOR BALANCE DETAIL FORM


Private Sub Form_Load() dat.Caption = Format(Date, "dd/mm/yy") tim.Caption = Format(Time, "hh:mm") mode.Caption = "#" & Form1.mode acno.Caption = Form1.acnumber Connect query = "select * from current_details where account_no=" & Form1.acnumber OpenRecordset 'rs.Open "select * from current_details where account_no=" & Form1.acnumber, con lbal.Caption = "RS. " & Format(rs.Fields(1), "#,##0.00") abal.Caption = "RS. " & Format(rs.Fields(1), "#,##0.00") CloseRecordset Set rs = Nothing Disconnect End Sub Private Sub QUIT_Click() Unload Me End Sub

52

FAST BANKING SERVICE

CODING FOR WITHDRAWL FORM


Dim mode As String Dim chk As Boolean Public wamt As Currency Public wtn As Integer Public wid As Integer Dim m As Integer Dim bal As Currency 'Public totamount As Integer Dim rs1 As New ADODB.Recordset Private Sub bycash_Click() mode = "CASH" chk = False cnumber.Visible = False cdat.Visible = False Label3.Visible = False Label4.Visible = False Label6.Visible = False Shape4.Visible = False Shape5.Visible = False End Sub Private Sub bycheque_Click() mode = "CHEQUE" chk = True cnumber.Visible = True cdat.Visible = True Label3.Visible = True Label4.Visible = True Label6.Visible = True Shape4.Visible = True Shape5.Visible = True End Sub
53

FAST BANKING SERVICE

Private Sub cancel_Click() Unload Me End Sub Private Sub Form_Load() cnumber.Visible = False cdat.Visible = False Label3.Visible = False Label4.Visible = False Label6.Visible = False Shape4.Visible = False Shape5.Visible = False mode = "CASH" Connect rs.Open "transact", con, adOpenDynamic, adLockOptimistic If rs.EOF Then wtn = 100 Else rs.MoveLast wtn = rs.Fields(0) wtn = wtn + 1 End If CloseRecordset Disconnect End Sub Private Sub withdraw_Click() If Form5.flag = True Then If Val(amt.Text) > Form5.amt Then MsgBox "Withdrawal is more than deposit", , "More Withdrawal" Exit Sub End If If Val(amt.Text) < Form5.amt Then
54

FAST BANKING SERVICE

MsgBox "Your current balance is " & Form5.amt & vbCrLf & " Please withdraw total amount", , "Less Withdrawal" Exit Sub End If Connect 'DELETING RECORDS FROM WITNESS_DETAILS TABLE ''query = "select * from witness_details where account_no=" & Form1.acnumber ''OpenRecordset ''rs.Delete ''CloseRecordset 'DELETING RECORDS FROM NOMINEE_DETAILS TABLE query = "select * from nominee_details where account_no=" & Form1.acnumber OpenRecordset Do While Not rs.EOF rs.Delete rs.MoveNext Loop CloseRecordset 'DELETING RECORDS FROM CURRENT_DETAILS TABLE query = "select * from current_details where account_no =" & Form1.acnumber OpenRecordset rs.Delete CloseRecordset 'DELETING RECORDS FROM DEPOSIT_DETAILS TABLE query = "select * from deposit_details where account_no =" & Form1.acnumber OpenRecordset Do While Not rs.EOF rs.Delete rs.MoveNext Loop CloseRecordset
55

FAST BANKING SERVICE

'DELETING RECORDS FROM WITHDRAW_DETAILS TABLE query = "select * from withdraw_details where account_no=" & Form1.acnumber OpenRecordset Do While Not rs.EOF rs.Delete rs.MoveNext Loop CloseRecordset 'DELETING RECORDS FROM FUND_TRANSFER_DETAILS TABLE query = "select * from fund_transfer_details where account_no=" & Form1.acnumber OpenRecordset Do While Not rs.EOF rs.Delete rs.MoveNext Loop CloseRecordset query = "select * from transact" OpenRecordset rs.AddNew rs.Fields(0) = wtn rs.Fields(1) = Form1.acnumber rs.Fields(2) = "WITHDRAW" rs.Fields(3) = wamt rs.Fields(4) = mode rs.Fields(5) = Date rs.Fields(6) = 0 rs.Fields(7) = "TRUE" rs.Update CloseRecordset 'SETTING CLOSED FIELD OF ACCOUNT_MASTER TABLE TO TRUE AND OPENING BALANCE TO ZERO query = "select * from account_master where account_no=" & Form1.acnumber
56

FAST BANKING SERVICE

OpenRecordset rs.Fields("closed") = "TRUE" rs.Fields("opening_amount") = Null rs.Update CloseRecordset Disconnect MsgBox " Thank you for enjoying our banking facilities " & vbCrLf & " Now your account has been closed", , "Account Closed" Me.Hide Form4.Hide End If If chk = True Then Check_All_Fields If m = 1 Then m=0 Exit Sub End If If DateDiff("d", Format(cdat, "mm/dd/yy"), Date) > 180 Then MsgBox "Your cheque is invalid on this date", , "Invalid cheque" Exit Sub Unload Me End If If DateDiff("d", Format(cdat, "mm/dd/yy"), Date) < 0 Then MsgBox "Cheque date is not applicable on this date", , "Not applicable" Exit Sub Unload Me End If wamt = Val(amt.Text) If Form1.mode = "SAVINGS" And Form1.chequefacility = "YES" Then If (Form4.curbal - wamt) < 1500 Then MsgBox "Minimum balance should be maintained RS. 1500", , "More Withdrawal" Exit Sub End If

57

FAST BANKING SERVICE

ElseIf Form1.mode = "SAVINGS" And Form1.chequefacility = "NO" Then If (Form4.curbal - wamt) < 1000 Then MsgBox "Minimum balance should be maintained RS. 1000", , "More Withdrawal" Exit Sub End If ElseIf Form1.mode = "CURRENT" And Form1.chequefacility = "YES" Then If (Form4.curbal - wamt) < 3000 Then MsgBox "Minimum balance should be maintained RS. 3000", , "More Withdrawal" Exit Sub End If ElseIf Form1.mode = "CURRENT" And Form1.chequefacility = "NO" Then If (Form4.curbal - wamt) < 2000 Then MsgBox "Minimum balance should be maintained RS. 2000", , "More Withdrawal" Exit Sub End If End If Connect query = "select * from current_details where account_no=" & Form1.acnumber OpenRecordset bal = rs.Fields(1) bal = wamt - bal rs.Fields(1) = bal rs.Update CloseRecordset rs.Open "transact", con, adOpenDynamic, adLockOptimistic, adCmdTable rs.AddNew rs.Fields(0) = wtn
58

FAST BANKING SERVICE

rs.Fields(1) = Form1.acnumber rs.Fields(2) = "WITHDRAW" rs.Fields(3) = wamt rs.Fields(4) = mode rs.Fields(5) = Date rs.Fields(6) = bal rs.Update CloseRecordset rs.Open "withdraw_details", con, adOpenDynamic, adLockOptimistic, adCmdTable rs.AddNew rs.Fields(0) = wtn rs.Fields(1) = Form1.acnumber rs.Fields(2) = Val(cnumber.Text) rs.Fields(3) = cdat.Text rs.Fields(4) = Date rs.Update CloseRecordset ElseIf chk = False Then Check_Amount_Only If m = 1 Then m=0 Exit Sub End If wamt = Val(amt.Text) If Form1.mode = "SAVINGS" And Form1.chequefacility = "YES" Then If (Form4.curbal - wamt) < 1500 Then MsgBox "Minimum balance should be maintained RS. 1500", , "More Withdrawal" Exit Sub End If ElseIf Form1.mode = "SAVINGS" And Form1.chequefacility = "NO" Then If (Form4.curbal - wamt) < 1000 Then

59

FAST BANKING SERVICE

MsgBox "Minimum balance should be maintained RS. 1000", , "More Withdrawal" Exit Sub End If ElseIf Form1.mode = "CURRENT" And Form1.chequefacility = "YES" Then If (Form4.curbal - wamt) < 3000 Then MsgBox "Minimum balance should be maintained RS. 3000", , "More Withdrawal" Exit Sub End If ElseIf Form1.mode = "CURRENT" And Form1.chequefacility = "NO" Then If (Form4.curbal - wamt) < 2000 Then MsgBox "Minimum balance should be maintained RS. 2000", , "More Withdrawal" Exit Sub End If End If Connect query = "select * from current_details where account_no =" & Form1.acnumber OpenRecordset 'rs.Open "select * from current_details where account_no =" & Form1.acnumber, con, adOpenDynamic, adLockOptimistic, adCmdText bal = rs.Fields(1) bal = bal - wamt rs.Fields(1) = bal rs.Update CloseRecordset query = "select * from transact" OpenRecordset 'rs.Open "transact", con, adOpenDynamic, adLockOptimistic, adCmdTable
60

FAST BANKING SERVICE

rs.AddNew rs.Fields(0) = wtn rs.Fields(1) = Form1.acnumber rs.Fields(2) = "WITHDRAW" rs.Fields(3) = wamt rs.Fields(4) = mode rs.Fields(5) = Date rs.Fields(6) = bal rs.Update CloseRecordset End If Disconnect wid = 1 Unload Me Form15.Show 1 End Sub Private Sub Check_Amount_Only() If amt.Text = "" Then MsgBox "Enter amount to deposit", , "Caution.." amt.SetFocus m=1 Exit Sub ElseIf Not IsNumeric(amt.Text) Then MsgBox "Must be entered numeric values", , "caution" amt.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub End If End Sub Private Sub Check_All_Fields() If amt.Text = "" Then MsgBox "Enter amount to deposit", , "Caution.."
61

FAST BANKING SERVICE

amt.SetFocus m=1 Exit Sub ElseIf Not IsNumeric(amt.Text) Then MsgBox "Must be entered numeric values", , "caution" amt.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub ElseIf cnumber.Text = "" Then MsgBox "Enter cheque number", , "Caution" cnumber.SetFocus m=1 Exit Sub ElseIf Len(cnumber.Text) <> 6 Then MsgBox "Cheque number must be of 6 digits", , "Caution" cnumber.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub ElseIf Not IsNumeric(cnumber.Text) Then MsgBox "Cheque number must be a number type", , "Caution" cnumber.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub ElseIf cdat.Text = "" Then MsgBox "Cheque date must be given", , "Caution" cdat.SetFocus m=1 Exit Sub ElseIf Not IsDate(cdat.Text) Then MsgBox "Must be entered cheque date", , "Caution" cdat.SetFocus SendKeys "{home}+{end}"
62

FAST BANKING SERVICE

m=1 Exit Sub End If End Sub

63

FAST BANKING SERVICE

CODING FOR DEPOSIT FORM


Dim chk As Boolean Dim m As Integer Dim am As Currency Dim bal As Currency Dim mode As String Public dtn As Integer Public dep As Integer Public damt As Currency Private Sub bycash_Click() mode = "CASH" chk = False cnumber.Visible = False cdat.Visible = False Label3.Visible = False Label4.Visible = False Label5.Visible = False Label6.Visible = False cbo.Visible = False Label6.Visible = False Shape4.Visible = False Shape5.Visible = False End Sub Private Sub bycheque_Click() mode = "CHEQUE" chk = True cnumber.Visible = True cdat.Visible = True Label3.Visible = True
64

FAST BANKING SERVICE

Label4.Visible = True Label5.Visible = True Label6.Visible = True cbo.Visible = True Label6.Visible = True Shape4.Visible = True Shape5.Visible = True End Sub Private Sub cancel_Click() Unload Me End Sub Private Sub deposit_Click() If chk = True Then Check_All_Fields If m = 1 Then m=0 Exit Sub End If If DateDiff("d", Format(cdat, "mm/dd/yy"), Date) > 180 Then MsgBox "Your cheque is invalid in this date", , "Invalid cheque" Exit Sub Unload Me End If If DateDiff("d", Format(cdat, "mm/dd/yy"), Date) < 0 Then MsgBox "Cheque date is not applicable on this date", , "Not applicable" Exit Sub Unload Me End If damt = Val(amt.Text) Connect query = "select * from current_details where account_no=" & Form1.acnumber OpenRecordset
65

FAST BANKING SERVICE

bal = rs.Fields(1) bal = bal + damt rs.Fields(1) = bal rs.Update CloseRecordset query = "select * from transact" OpenRecordset rs.AddNew rs.Fields(0) = dtn rs.Fields(1) = Form1.acnumber rs.Fields(2) = "DEPOSIT" rs.Fields(3) = damt rs.Fields(4) = mode rs.Fields(5) = Date rs.Fields(6) = bal rs.Update CloseRecordset query = "select * from deposit_details" OpenRecordset rs.AddNew rs.Fields(0) = dtn rs.Fields(1) = Form1.acnumber rs.Fields(2) = cnumber.Text rs.Fields(3) = cdat.Text rs.Fields(4) = cbo.Text rs.Fields(5) = DateAdd("d", 3, Date) rs.Update CloseRecordset ElseIf chk = False Then Check_Amount_Only If m = 1 Then m=0 Exit Sub End If damt = Val(amt.Text)
66

FAST BANKING SERVICE

Connect query = "select * from current_details where account_no =" & Form1.acnumber OpenRecordset bal = rs.Fields(1) bal = bal + damt rs.Fields(1) = bal rs.Update CloseRecordset query = "select * from transact" OpenRecordset rs.AddNew rs.Fields(0) = dtn rs.Fields(1) = Form1.acnumber rs.Fields(2) = "DEPOSIT" rs.Fields(3) = damt rs.Fields(4) = mode rs.Fields(5) = Date rs.Fields(6) = bal rs.Update CloseRecordset End If Disconnect dep = 1 Unload Me Form15.Show 1 End Sub Private Sub Check_Amount_Only() If amt.Text = "" Then MsgBox "Enter amount to deposit", , "Caution.." amt.SetFocus m=1 Exit Sub ElseIf Not IsNumeric(amt.Text) Then
67

FAST BANKING SERVICE

MsgBox "Must be entered numeric values", , "caution" amt.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub End If End Sub Private Sub Form_Load() cnumber.Visible = False cdat.Visible = False Label3.Visible = False Label4.Visible = False Label5.Visible = False Label6.Visible = False cbo.Visible = False Label6.Visible = False Shape4.Visible = False Shape5.Visible = False mode = "CASH" Connect query = "select * from transact" OpenRecordset 'rs.Open "transact", con, adOpenDynamic, adLockOptimistic If rs.EOF Then dtn = 100 Else rs.MoveLast dtn = rs.Fields(0) dtn = dtn + 1 End If CloseRecordset Disconnect End Sub

68

FAST BANKING SERVICE

Private Sub Check_All_Fields() If amt.Text = "" Then MsgBox "Enter amount to deposit", , "Caution.." amt.SetFocus m=1 Exit Sub ElseIf Not IsNumeric(amt.Text) Then MsgBox "Must be entered numeric values", , "caution" amt.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub ElseIf cnumber.Text = "" Then MsgBox "Enter cheque number", , "Caution" cnumber.SetFocus m=1 Exit Sub ElseIf Len(cnumber.Text) <> 6 Then MsgBox "Cheque number must be of 6 digits", , "Caution" cnumber.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub ElseIf Not IsNumeric(cnumber.Text) Then MsgBox "Cheque number must be a number type", , "Caution" cnumber.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub ElseIf cdat.Text = "" Then MsgBox "Cheque date must be given", , "Caution" cdat.SetFocus m=1 Exit Sub ElseIf Not IsDate(cdat.Text) Then
69

FAST BANKING SERVICE

MsgBox "Must be entered cheque date", , "Caution" cdat.SetFocus SendKeys "{home}+{end}" m=1 Exit Sub End If End Sub

70

FAST BANKING SERVICE

CODING FOR FUND TRANSFER FORM


Dim bal As Currency Dim minbal As Currency Private Sub cancel_Click() Unload Me End Sub Private Sub Form_Load() If Form1.mode = "SAVINGS" And Form1.chequefacility = "YES" Then minbal = 1500 ElseIf Form1.mode = "SAVINGS" And Form1.chequefacility = "NO" Then minbal = 100 ElseIf Form1.mode = "CURRENT" And Form1.chequefacility = "YES" Then minbal = 3000 Else minbal = 200 End If End Sub Private Sub transfer_Click() If acnumber.Text = "" Then MsgBox "Account number must be entered" & Chr(13) & " to whom money is transferred", , "Error.." acnumber.SetFocus Exit Sub End If If amt.Text = "" Then MsgBox "How much money is transferred", , "Error.." amt.SetFocus Exit Sub End If
71

FAST BANKING SERVICE

If Val(acnumber.Text) = Form1.acnumber Then MsgBox "You cannot transfer money to your account", , "Transfer Problem" acnumber.SetFocus SendKeys "{home}+{end}" Exit Sub End If Connect rs.Open "select * from current_details where account_no=" & Val(acnumber.Text), con, adOpenDynamic, adLockOptimistic If rs.EOF Then MsgBox "Such account number does not exist", , "Error..." CloseRecordset Disconnect Exit Sub Else CloseRecordset rs.Open "select * from current_details where account_no =" & Form1.acnumber, con, adOpenDynamic, adLockOptimistic bal = rs.Fields(1) bal = bal - Val(amt.Text) If bal < minbal Then MsgBox "You cannot transfer money more than deposits" & vbCrLf & " You cannot leave your account to zero balance" & vbCrLf & " You have to maintain minimum balance of Rs = " & minbal, , "Error.." CloseRecordset Disconnect Exit Sub End If rs.Fields(1) = bal rs.Update CloseRecordset query = "select * from current_details where account_no=" & Val(acnumber.Text) OpenRecordset
72

FAST BANKING SERVICE

bal = rs.Fields(1) bal = bal + Val(amt.Text) rs.Fields(1) = bal rs.Update CloseRecordset rs.Open "fund_transfer_details", con, adOpenDynamic, adLockOptimistic rs.AddNew rs.Fields(0) = Form1.acnumber rs.Fields(1) = Val(amt.Text) rs.Fields(2) = Val(acnumber.Text) rs.Fields(3) = Date rs.Update CloseRecordset Disconnect MsgBox Val(amt.Text) & " amount transferred to " & Val(acnumber.Text) & " account number", , "Successfully Transferred" Unload Me End If End Sub

73

FAST BANKING SERVICE

CODING FOR ACCOUNT MODIFICATION FORM


Dim cf As String Dim md As String Dim atype As String Dim num As Integer Private Sub cancel_Click() CloseRecordset Disconnect Unload Me End Sub Private Sub Form_Load() SendKeys "{HOME}+{END}" acnumber = Val(Form1.acnotext.Text) Connect query = "select * from account_master where account_no=" & acnumber OpenRecordset 'rs.Open query, con, adOpenDynamic, adLockOptimistic, adCmdText If rs.Fields("closed") = "TRUE" Then MsgBox "your account is closed" CloseRecordset Disconnect Unload Me End If If rs.Fields("mode") = "SINGLE" Then jacname.Enabled = False jacage.Enabled = False jacoccup.Enabled = False Text1(5).Visible = False Text1(6).Visible = False Text1(7).Visible = False optsingel.Value = True Text1(0).Text = rs.Fields(1)
74

FAST BANKING SERVICE

Text1(1).Text = rs.Fields(3) Text1(2).Text = rs.Fields(6) Text1(3).Text = rs.Fields(8) Text1(4).Text = rs.Fields(9) Else optjoint.Value = True Text1(0).Text = rs.Fields(1) Text1(1).Text = rs.Fields(3) Text1(2).Text = rs.Fields(6) Text1(3).Text = rs.Fields(8) Text1(4).Text = rs.Fields(9) Text1(5).Text = rs.Fields(4) Text1(6).Text = rs.Fields(5) Text1(7).Text = rs.Fields(7) End If If rs.Fields(11) = "SAVINGS" Then optsaving.Value = True Else optcurrent.Value = True End If If rs.Fields(10) = "YES" Then optyes.Value = True Else optno.Value = True End If End Sub Private Sub modify_Click() rs.Fields(1) = UCase(Text1(0).Text) rs.Fields(3) = Val(Text1(1).Text) rs.Fields(6) = UCase(Text1(2).Text) rs.Fields(8) = UCase(Text1(3).Text) rs.Fields(9) = Text1(4).Text If num = 1 Then rs.Fields(4) = ""
75

FAST BANKING SERVICE

rs.Fields(5) = Null rs.Fields(7) = "" Else rs.Fields(4) = UCase(Text1(5).Text) rs.Fields(5) = Val(Text1(6).Text) rs.Fields(7) = UCase$(Text1(7).Text) End If rs.Fields(11) = atype rs.Fields(10) = cf rs.Fields("mode") = md rs.Update MsgBox "Account details successfully modified", vbOKOnly + vbInformation, "Account Modified" CloseRecordset Disconnect Unload Me End Sub Private Sub optyes_Click() cf = "YES" End Sub Private Sub optno_Click() cf = "NO" End Sub Private Sub optsaving_Click() atype = "SAVINGS" End Sub Private Sub optcurrent_Click() atype = "CURRENT" End Sub Private Sub optsingel_Click()
76

FAST BANKING SERVICE

md = "SINGLE" jacname.Enabled = False jacage.Enabled = False jacoccup.Enabled = False Text1(5).Visible = False Text1(6).Visible = False Text1(7).Visible = False Shape8.Visible = False Shape9.Visible = False Shape10.Visible = False num = 1 End Sub Private Sub optjoint_Click() md = "JOINT" jacname.Enabled = True jacage.Enabled = True jacoccup.Enabled = True Text1(5).Visible = True Text1(6).Visible = True Text1(7).Visible = True Shape8.Visible = True Shape9.Visible = True Shape10.Visible = True num = 2 End Sub Private Sub Text1_GotFocus(Index As Integer) SendKeys "{HOME}+{END}" End Sub

77

FAST BANKING SERVICE

CODING FOR TRANSACTION DETAIL FORM


Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() query = "select * from transact where account_no=" & Form1.acnumber Connect OpenRecordset Dim totalRowCount As Long Dim a As Long totalRowCount = 0 Do While Not rs.EOF totalRowCount = totalRowCount + 1 rs.MoveNext Loop If totalRowCount > 0 Then rs.MoveFirst MSHFlexGrid1.Rows = totalRowCount MSHFlexGrid1.ColWidth(0) = 2000 MSHFlexGrid1.ColWidth(1) = 2000 MSHFlexGrid1.ColWidth(2) = 1500 MSHFlexGrid1.ColWidth(3) = 1500 MSHFlexGrid1.ColWidth(4) = 2500 MSHFlexGrid1.ColWidth(5) = 2300 End If RowCount = -1 Do While Not rs.EOF RowCount = RowCount + 1 MSHFlexGrid1.Col = 0 MSHFlexGrid1.Row = RowCount MSHFlexGrid1.Text = rs.Fields(0)
78

FAST BANKING SERVICE

For X = 1 To 5 MSHFlexGrid1.Col = X MSHFlexGrid1.Row = RowCount MSHFlexGrid1.Text = rs.Fields(X + 1) Next X If rs.Fields(2) = "DEPOSIT" Then a = a + rs.Fields(6) ElseIf rs.Fields(2) = "WITHDRAW" Then a = a - rs.Fields(6) End If rs.MoveNext Loop CloseRecordset Disconnect End Sub

79

Das könnte Ihnen auch gefallen