Petrol Pump: Department of Computer Science

Download as pdf or txt
Download as pdf or txt
You are on page 1of 74

Petrol Pump

A Project Report Submitted in Partial Fulfillment Of the Requirements for the Award of BCA Of the

Department of Computer Science


BIIT College, Jagdalpur

CERTIFICATE -1

CERTIFICATE OF APPROVAL This is to certify that the project work entitled Petrol Pump submitted by Harish Nag in partial fulfillment of the requirements for the award of BCA, session 2012 at BIIT College, to Panjab Technical University, Jagdalpuris a record of the students own work. This work has not been submitted to any other University or institute for the award of any degree or diploma to the best of my knowledge.

(Signature of HOD with Date) (Name) (College)

CERTIFICATE 2

CERTIFICATE OF EVALUATION This is to certify that the project report entitled Petrol Pump being submitted by Harish Nag in partial fulfillment of the requirements for the award of BCA, session 2012 at BIIT College, to Panjab Technical University, Jagdalpur, is a record of the students own work. This work has not been submitted to any other University or institute for the award of any degree or diploma to the best of my knowledge.

Internal Examiner Date: Designation:

External Examiner Date: Designation:

CERTIFICATE 3
CERTIFICATE OF ORIGINALITY This is to certify that the project report entitled Petrol Pump in partial fulfillment of the requirements for the award of BCA, session 2012 to Panjab Technical University, Jagdalpur, is carried out by Harish Nag, under my supervision & guidance. The matter embodied in this project is genuine work done by the student and has not been submitted to this or any other University or institute for the award of any degree or diploma to the best of my knowledge.

Signature of Project Guide Date: Name: Designation

CERTIFICATE 4
SELF CERTIFICATE This to certify that the project report entitled Petrol Pump is done by me is an authentic work carried out for the partial fulfillment of the requirements for the award of the BCA, under the guidance of Mr. Hulesh Chandra

Name of the student

Roll No.

Signature of the student

ACKNOWLEDGEMENT
The austerity and satisfaction that one gets on completing a project cannot be fulfilled without mentioning the people who made it possible, with gratitude, we are very much thankful to the Almighty God who helped us all the way throughout the project and who has molded us into what we are today. I am privileged to express my sincere gratitude to honorable Rev. Mr. L.Patel, Principal, BIIT College, Jagdalpur for all encouragement he gave us. I express my sincere thanks to extreme gratitude to Mr. Hulesh Chandra(H.O.D.) of Computer Science for all his valuable suggestions and guidance throughout our project. I wish to express my hearty gratitude to our internal project guide, Mr. Hulesh Chandra for his valuable suggestions and guidance throughout the tenure of our project .I extend my sincere thanks to all the college staff members who helped me to complete this project successfully. Finally, I express my sincere thanks to our entire friends and all the other people who had imparted their knowledge and expertise upon me.

SYNOPSIS
CONTENTS:CHAPTER 1
1.1

INTRODUCTION
1.1.1 The Organization Profile 1.1.2 Study of existing System

Background Study

1.2

Project Overview

CHAPTER 2
2.1

PROBLEM ANALYSIS
2.1.1 2.1.2 Problem Definition Solution Strategies

Study of proposed System

2.2

System Requirements 2.2.1 Hardware Requirements 2.2.2 Software Requirements

2.3 2.4

Software Justification Cost Estimating & Scheduling

CHAPTER 3 DESIGN & DEVELOPMENT PROCESS


3.1 3.2 Module Design Design Notations
3.2.1 Data Flow Diagram

3.3

Design Process
3.3.1 3.3.2 3.3.3 Database Design Input design Output design

CHAPTER 4 TESTING & IMPLEMENTATION


4.1 4.2 System Testing System implementation
4.2.1 4.2.2 Implementation procedures Operational documentation

4.3

System Maintenance

CHAPTER - 5 CONCLUSION
5.1 Scope for further Enhancement 5.2 Bibliography 5.3 Annexure
5.3.1 Input design 5.3.2 Output design 5.3.3 Source code

5.4 Abbreviations

CHAPTER 1 INTRODUCTION
1.1 BACKGROUND STUDY
1.1.1 The Organizational profile
This project is developed for Office Of The Chief Executive Officer Janpad Panchayat, Makri in which there are 3 Sections Establishment, Finance, N.R.E.G.A. Maintanance and staffs are
C.E.O. Sub Engineer A.DEO Accountant Ast. Grade 2 Ast Grade 3 Computer Operator Driver

Peon

1.1.2 Study of existing system


Earlier the management process were carried out with the help of hand written registers, self calculations were done in order to calculate the Monthly Attendance, Salary, Gratuity, Pension etc.

1.2 Project Overview


This project is a management system for employee of The Office of the Chief Executive Officer Janpad Panchayat, Makri where the computerized management of employee will be done through the help of this project.

CHAPTER 2 PROBLEM ANALYSIS

2.1 Study of proposed System


2.1.1 Problem Definition
In the earlier management process there were the problem of maintanence because hand written maintenance is very time taking process it needs a very skill person in accounting and management It haves lots of disadvantages: As we seen earlier that it is time taking process. Error may definitely arise. Destruction can destroy all the important works

2.1.2 Solution Strategies


So the solution for this problem is to computerized the system of management process. To make a software which can perform the following functions: Employee details Attendance Record Salary Calculation Gratuity Calculation Pension Calculation Bill Generation etc.

2.2 System Requirements

2.2.1 Hardware Requirements


The configuration given below is the Hardware handled for the system development. Processor Primary Memory (RAM) Secondary Memory (Harddisk) : : PENTIUM IV 2.00 GHz : 512 MB 20 GB

2.2.2 Software Requirements

Operating System Front End tool Back End tool

: Windows XP : Visual Basic 6.0 : MS-Access

2.3
Operating System

Software Justification

As the company is presently has its showroom in One place, STANDALONE system is proposed with WINDOWS XP operating system.

Front End tool :- Visual Basic 6.0


Microsoft Visual Basic 6.0 is the powerful programming language to develop application for windows. Windows is the operating system, which runs based on messages and with rich user interface. Here are little details about how windows works and programming model using Visual Basic.

UNDERSTANDING THE EVENT-DRIVEN MODEL


In traditional or procedural applications, the application itself controls which portions of code execute and in what sequence. Execution starts with the first line of code and follows a predefined path through the application, calling procedures as needed. In an event-driven application, the code doesnt follow a predetermined path it executes different code sections in response to events. Events can be triggered by the users actions, by messages from the system or other applications, or even from the application itself. The sequence of

these events determines the sequence in which the code executes, thus the path through the applications code differs each time the program runs. Because we cant predict the sequence of events, our code must make certain assumptions about the state of the world when it executes. When we make assumptions (for example, that an entry field must contain a value before running a procedure to process that value), we should structure our application in such a way as to make sure that the assumption will always be valid (for example, disabling the command button that starts the procedure until the entry field contains a value). Our code can also trigger events during execution. For example, programmatically changing the text in a text box cause the text boxs Change event to execute. Thats why it is very important to understand the event-driven model and keep it in mind when we design the application.

USER INTERFACE ELEMENTS


Visual Basic provides us a lot of User Interface elements, which are easier to create and use. For example Forms, Menus, dialog boxes and supporting controls such as Check Box, List Box, Edit Box, Etc.

DATA BASE CONNECTIVITY


Visual Basic supports a lot for data base connectivity; we can use ODBC to connect with different databases like Oracle, Sybase, Etc. And we have use DAO (Data Access Objects) mainly used for Microsofts jet data base engine. We can use ADO to access databases, the following explains about ADO

ACTIVE X DATA OBJECTS (ADO)


Active X Data objects (ADO) enables client applications to access and manipulate data from a database server through an OLE DB provider. Its primary benefits are ease of use, high speed, low memory overhead, and a small disk footprint. ADO supports key features for building client/server and Web-based applications.ADO also features Remote Data Service (RDS), by which we an move data from a server to a client application or Web page, manipulate the data on the client, and return updates to the server in a single round trip.

DYNAMIC LINK LIBRARIES (DLL)


Dynamic Link Libraries (DLL) is linked dynamically as the program executes. Unlike Static Link Libraries, these libraries provide us a lot of advantages. DLLs are executables, which can be linked when required. And the main advantage is more than one application can use the same DLLs. In Visual Basic we can create and use DLLs.

ACTIVE X CONTROLS
An ActiveX control is an execution to the Visual Basic Toolbox. We can use Active X controls just like any of the standard built-in controls, such as the Check Box control. When we add is Active X control to a program, it becomes part of the development and run-time environment and provides new functionality for the application.

BACK END TOOL


MS-Access
On a program of software that can help us to access data and perform operations it is called a Data Base Management System. The DBMS whose design is based on the Relational Theory is called The Relational Database Management System or RDBMS. MS-Access is a RDBMS, offers capabilities of both Relational and Object Oriented database systems. It supports very large databases that could contain hundreds of terabytes of information. The records are represented in a flat two-dimensional table with rows and columns. Each column has an unique name. All elements in each column are of same kind. MS-Access provides access to many concurrent users to the order of thousands managing large amount of data could present administrative and performance challenges. MS-Access is the default backend for Visual Basic. Creating tables and making data entries in MS-Access are made easier. It has the advantage of querying. It is more faster in retrieving data. The data can also be external to the database. It has enriched data types.

2.4

Cost Estimating & Scheduling

Project estimation and scheduling were carried out together by the project leader as Per the norms of the company. Some cost estimation was done at the early stage before the schedules were drawn up. Once the project was underway, estimates were updated. The factors involved in computing the total cost of a software project were:
Hardware & software cost, Maintenance cost, Travel and training cost and

Effort cost.

Scheduling as well as estimating the effort required to develop the software system were done by the project leader in discussion with the Company officials. The project was sub moduled and each module was given a dead line of completion. Tests were scheduled on completion of each module.

CHAPTER 3 DESIGN & DEVELOPMENT PROCESS

3.1

MODULE DESIGN

Module design means breaking your programming task in to small parts. The advantage of modularity is in easy accessing of coding and debugging, also more number of programmers can engage in a companys software development and

the work can be finished quickly. Even very big developments can be finished within a targeted minimum time by splitting the program in to small parts. This project has mainly classified into two Modules, they are: 1). User module
User can perform following function:User Can add
Item record Customer record Dealer record Meter reading information Company information Purchase record

2). Administrator
Administrator can perform all the function which user cannot such as
Meter reading rates Changing Administrative Password User Password too Setting Pay Scale

Real time projects, that too customers based projects always will be with more reports, as the customer needs better visual of their stored details. This module area of Reporting has one reports which will give a clear identification of the project needs.

3.2

DESIGN NOTATIONS

DATA FLOW DIAGRAM


LOGIN FORM

MDI FORM

VOUCHER ENTRY

RECORD

METER

SECURITY

EXIT

PRODUCT SALE PRODUCT PURCHASEE

COMPANY

METER READINGG

CHANGE PASSWORD

YES

CUSTOMER

NO

DEALER

ITEM

4.1.1 INPUT DESIGN


Errors committed by data entry operator can be controlled by the input design. The following approaches have been incorporated into the input design of the proposed system.

MENU
A menu is a selection list that simplifies the data entry the user can choose from a list of option, by typing the option letter associated with option in position where the cursor is located. This project has one Graphical Menu. Selected from the toolbar. Graphical Menu is designed in such a way that, if the user moves the mouse cursor above the main option sub options displayed automatically.

FORMATTED SCREEN
Data entry screens have been designed which are similar in formatting source documents. Help screens have been designed the user to enter data without confusion.

DATA VALIDATION
The input data are validated to minimize errors validation is done. In certain cases validation is made to check whether the given data is numeric or not.

USER FRIENDLINESS
Appropriate messages are provided to the user to inform of what is happening. Errors are used to indicate the error code and specific error message.

CONSISTENT FORMAT
A fixed format is adopted for displaying the title and the messages. Each screen has a status line, which displays the operation that can be performed after data entry.

INTERACTIVE DIALOGUE
The system participates in interactive dialogue and is able to cope with missing or omitted information. It covers the dialogue by retaining adequate information between each dialogue.

3.3.3 OUTPUT DESIGN


It is necessary that the output reports be compatible format with the manual reports. The output has been designed in mind. Output design is the basis by which many users evaluate the usefulness of the system. The output forms used in this software are required for query response and reports. The emphasis is required for producing the hard copy of the information requested or displaying the output on a CRT screen.

CHAPTER - 4 TESTING & IMPLEMENTATION

4.1 SYSTEM TESTING


Software testing is a crucial element of software quality assurance and represents the ultimate review of specification, design and coding. The increasing visibility of software as a system element and the attendant "cost" associated with a software failure are motivating forces for well-planned, thorough testing. Testing is a set of activities that can be planned in advance and conducted systematically. Testing begins at the module level and work towards the integration of entire computers based system. Nothing is complete without testing, as it is vital success of the system.

Unit Testing
Unit testing focuses on the verification of smallest unit of software design of the module. To check whether each module in the software works properly so that it gives desired outputs to the given inputs. All validations and conditions are tested in the module level in unit test. Control paths are tested to ensure the information properly flows into and out of the program unit under test. Boundary condition are tested to ensure that the modules operates at boundary establishes to restrict processing. All independent paths through control structure are exercised to ensure that all statements in a module have been executed at least once. And finally all error handling paths are tested. In our system, Unit testing has been successfully handled. The test data was given to each module in all respects and have got desired output. Each module has been found working properly.

Black Box Testing


Black Box Testing methods focus on the functional requirements of the software. This testing enables the software engineer to derive sets of input conditions that will fully exercise all functional requirements for a program. This testing attempts to find errors in the following categories: incorrect or missing functions, interface errors, errors in data structure or external database access, performance errors and initialization errors and termination errors. In our system, Black Box testing has been successfully handled. The test input data was given has got desired output.

Integration Testing
Integration Testing is a systematic technique for constructing the program structure, while conducting test to recover errors associated with interfacing. The problem is interfacing data can be lost across an interface, one module can have an inadvertent, adverse effect on another subfunctions, when combined may not produce the expected major function. Global data structure can present problems in the testing when all modules are

combined and entire program is tested as a whole. In our case all the modules were combined and given the test data. The combined modules work successfully without any side effect on other programs and everything was found working fine.

User Acceptance Testing


The performance of user interactive testing is actually the user show. The user gives live data and checks whether software is giving specified outputs.

4.2

SYSTEM IMPLEMENTATION

Implementation is the phase where the system goes for actual functioning. Hence in this phase one has to be cautious because all the efforts undertaken during the project will be fruitful only if the software is properly implemented according to the plans made. The implementation phase is less creative than system design. It is primarily concerned with user training, site preparation and file conversion. Depending on the nature of the system, extensive user training may be required. The initial parameters of the MIS should be modified as the result of

programming efforts; programming provides a reality test for the assumptions made by the analyst. The system testing checks the readiness and accuracy of the system to access, update and retrieve data from new files. Once the programs become available, the test data are read into the computer and process.

4.3
program is released for use.

SYSTEM MAINTENANCE

We may define Software Maintenance by describing four activities that are undertaken after a

Corrective Maintenance
The first maintenance activity occurs since it is unreasonable to assume that software testing will uncover all errors in a large software system. The process of including the diagnosis and correction of one or more errors is called corrective maintenance.

Adaptive Maintenance
This activity that contributes to the definition of maintenance occurs since rapid change is encountered in every aspect of computing. Therefore, adaptive maintenance modifies software to properly interface with the changing environment.

Perfective Maintenance
This activity involves recommendations for new capabilities, modifications to the existing functions and

general enhancements when the software is used. To satisfy these requests, perfective maintenance is performed.

Preventive Maintenance
This activity occurs when software is changed to improve further maintainability or reliability. If the only available element of a Software Configuration is the source code, maintenance activity begins with the evaluation of the code, often complicated by poor internal documentation. The subtle characteristics such as program structure, global data structure, system interfaces and performance & design constraints are difficult to handle and are often misinterpreted. The amounts of changes that are made to the code are difficult to access.

CHAPTER - 5 CONCLUSION

5.1 SCOPE FOR FUTHER ENHANCEMENT


The Petrol Pump Management System didnt automate 100% of their work, but it is really a good start to computerize everything and entire petrol pump management can be 100% computerized. As far as the work done so far much care was given about the user friendliness and a very good interaction with the end users. The interface are so designed and channeled the users can never make any mistake while using the application, for and example while adding new record, users cant go out without either saving or canceling the operation, till the time either they save or cancel the current operation all other operations are blocked. There is no chance of making any mistake in the application.

Search details can be enhanced by detailed identification of searching problems and rectification steps by company.This system is entirely designed for STAND ALONE usage, according to the need of the office, if needed the same system can be designed with Network facility to handle the branch activities also.

3 Source code

Main Form
Private Sub MDIForm_Load()

End Sub

Private Sub mnuchange_Click() Beep frmpasschange.Show End Sub

Private Sub mnucompany_Click() Beep frmCompany.Show End Sub

Private Sub mnucustomer_Click() Beep frmcustomer.Show End Sub

Private Sub mnudealer_Click() Beep frmDealer.Show End Sub

Private Sub mnuitem_Click() Beep frmitem.Show End Sub

Private Sub mnupurchase_Click()

Beep frmPurchase.Show End Sub

Private Sub mnureading_Click() Beep frmmeter.Show End Sub

Private Sub mnusale_Click() Beep frmsale.Show End Sub

Private Sub mnuyes_Click() Beep Unload Me End Sub

Product Purchase form


Private Sub txtBillDate_Change() txtBillDate.Enabled = False End Sub

Private Sub txtBillNo_LostFocus() PurRs.FindFirst "billno = '" & txtBillNo.Text & "'" If PurRs.NoMatch Then txtBillDate.Text = Date cmdsave.Enabled = True Else Set PurEditRs = myDB.OpenRecordset("select * from purchase where billno='" & txtBillNo.Text & "'") PurEditRs.MoveLast nr = PurEditRs.RecordCount PurEditRs.MoveFirst ItemRs.FindFirst "itemname ='" & PurEditRs!itemname & " ' "

If PurEditRs!Status = "CREDIT" Then optCredit.Value = True Call optCredit_Click DealerRs.MoveFirst Do While Not DealerRs.EOF comDealerName.AddItem DealerRs!dealername DealerRs.MoveNext Loop comDealerName.Text = PurEditRs!dealername End If txtBillDate.Text = PurEditRs!Date PurEditRs.MoveFirst For i = 0 To nr - 1 loaddata (i) PurEditRs.MoveNext Next i lblgqtotal = 0 lblamttotal = 0 PurEditRs.MoveFirst For i = 0 To nr - 1 lblgqtotal = Val(lblgqtotal) + Val(txtQtyTotal(i)) lblamttotal = Val(lblamttotal) + Val(txtAmt(i)) Next t=1 End If End Sub

Private Sub loaddata(index As Integer) If index > 0 Then Load comItemName(index) Load txtQtyG(index) Load txtQtyS(index) Load txtQtyTotal(index) Load txtUnit(index) Load txtRate(index) Load txtAmt(index) Load comMore(index)

comItemName(index).Top = comItemName(index - 1).Top + 435 txtQtyG(index).Top = txtQtyG(index - 1).Top + 435 txtQtyS(index).Top = txtQtyS(index - 1).Top + 435 txtQtyTotal(index).Top = txtQtyTotal(index - 1).Top + 435 txtUnit(index).Top = txtUnit(index - 1).Top + 435 txtRate(index).Top = txtRate(index - 1).Top + 435 txtAmt(index).Top = txtAmt(index - 1).Top + 435 comMore(index).Top = comMore(index - 1).Top + 435

comItemName(index).Visible = True txtQtyG(index).Visible = True txtQtyS(index).Visible = True txtQtyTotal(index).Visible = True txtUnit(index).Visible = True txtRate(index).Visible = True txtAmt(index).Visible = True comMore(index).Visible = True ItemRs.MoveFirst Do While Not ItemRs.EOF comItemName(index).AddItem ItemRs!itemname ItemRs.MoveNext Loop End If txtQtyS(index).Text = PurEditRs!sqty comItemName(index).Text = PurEditRs!itemname txtQtyG(index).Text = PurEditRs!gqty txtQtyTotal(index).Text = Val(txtQtyS(index)) + Val(txtQtyG(index)) ItemRs.FindFirst "itemname" = PurEditRs!itemname txtUnit(index).Text = ItemRs!unit ItemRs.FindFirst "itemname ='" & PurEditRs!itemname & "'" txtRate(index).Text = ItemRs!Rate txtAmt(index).Text = Val(txtQtyTotal(index)) * Val(txtRate(index)) comMore(index).AddItem "N" comMore(index).AddItem "Y" End Sub

Private Sub comMore_LostFocus(index As Integer) If comMore(index).Text = "Y" Then comMore(index).Enabled = False tRec = index + 1 CreatRow (tRec) End If End Sub

Private Sub txtQtyG_LostFocus(index As Integer) txtQtyTotal(index).Text = Val(txtQtyG(index)) + Val(txtQtyS(index)) txtAmt(index).Text = Val(txtQtyTotal(index)) * Val(txtRate(index)) lblgqtotal = 0 lblamttotal = 0 If t = 1 Then rec = nr - 1 Else rec = tRec End If For i = 0 To rec lblgqtotal = Val(lblgqtotal) + Val(txtQtyTotal(i)) lblamttotal = Val(lblamttotal) + Val(txtAmt(i)) Next End Sub Private Sub CreatRow(index As Integer) If index > 5 Then For i = 0 To index - 1 comItemName(i).Top = comItemName(i).Top - 435 txtQtyG(i).Top = txtQtyG(i).Top - 435 txtQtyS(i).Top = txtQtyS(i).Top - 435 txtQtyTotal(i).Top = txtQtyTotal(i).Top - 435 txtUnit(i).Top = txtUnit(i).Top - 435 txtRate(i).Top = txtRate(i).Top - 435 txtAmt(i).Top = txtAmt(i).Top - 435 comMore(i).Top = comMore(i).Top - 435 Next vscItem.Min = vscItem.Min - 1 End If

Load comItemName(index) comItemName(index).Top = comItemName(index - 1).Top + 435 ItemRs.MoveFirst Do While Not ItemRs.EOF comItemName(index).AddItem ItemRs!itemname ItemRs.MoveNext Loop comItemName(index).Visible = True Load txtQtyG(index) txtQtyG(index).Top = txtQtyG(index - 1).Top + 435 txtQtyG(index).Visible = True txtQtyG(index).Text = 0 Load txtQtyS(index) txtQtyS(index).Top = txtQtyS(index - 1).Top + 435 txtQtyS(index).Visible = True txtQtyS(index).Text = 0 Load txtQtyTotal(index) txtQtyTotal(index).Top = txtQtyTotal(index - 1).Top + 435 txtQtyTotal(index).Visible = True txtQtyTotal(index).Text = 0 Load txtUnit(index) txtUnit(index).Top = txtUnit(index - 1).Top + 435 txtUnit(index).Visible = True txtUnit(index).Text = "" Load txtRate(index) txtRate(index).Top = txtRate(index - 1).Top + 435 txtRate(index).Visible = True txtRate(index).Text = 0 Load txtAmt(index) txtAmt(index).Top = txtAmt(index - 1).Top + 435 txtAmt(index).Visible = True txtAmt(index).Text = 0 Load comMore(index) comMore(index).Top = comMore(index - 1).Top + 435 comMore(index).Visible = True comMore(index).Text = "N" comMore(index).Enabled = True

comMore(index).AddItem "N" comMore(index).AddItem "Y" comItemName(index).SetFocus End Sub

Private Sub txtQtyS_LostFocus(index As Integer) txtQtyTotal(index).Text = Val(txtQtyG(index)) + Val(txtQtyS(index)) txtAmt(index).Text = Val(txtQtyTotal(index)) * Val(txtRate(index)) lblgqtotal = 0 lblamttotal = 0 If t = 1 Then rec = nr - 1 Else rec = tRec End If For i = 0 To rec lblgqtotal = Val(lblgqtotal) + Val(txtQtyTotal(i)) lblamttotal = Val(lblamttotal) + Val(txtAmt(i)) Next End Sub

Private Sub vscItem_Change() If tvsc > vscItem.Value Then togle = -1 Else togle = 1 End If For i = 0 To tRec comItemName(i).Top = comItemName(i).Top - 435 * togle txtQtyG(i).Top = txtQtyG(i).Top - 435 * togle txtQtyS(i).Top = txtQtyS(i).Top - 435 * togle txtQtyTotal(i).Top = txtQtyTotal(i).Top - 435 * togle txtUnit(i).Top = txtUnit(i).Top - 435 * togle txtRate(i).Top = txtRate(i).Top - 435 * togle txtAmt(i).Top = txtAmt(i).Top - 435 * togle comMore(i).Top = comMore(i).Top - 435 * togle Next

'vscItem.Max = vscItem.Max + 1 tvsc = vscItem.Value End Sub

Product Sale
Option Explicit Dim agqt() Dim asqt() Dim aname() Dim t As Integer Dim rec As Integer Dim nr As Integer Dim msg As String Dim style As String Dim title As String Dim i As Integer Dim temp As Integer Dim stay As String Dim tRec As Integer ' total Records -> for total no of row created in add mode Dim tvsc As Integer ' temp vertical scroll for check the scroll value Dim togle As Integer 'for up down of scroll value between +1 or -1 Private Sub cmdedit_Click() temp = 1 Set saleeditrs = myDB.OpenRecordset("select * from sale where vno='" & txtVNo.Text & "' ", dbOpenDynaset) saleeditrs.MoveLast nr = saleeditrs.RecordCount ReDim agqt(nr) ReDim asqt(nr) ReDim aname(nr) For i = 0 To nr - 1 agqt(i) = Val(txtQtyG(i)) asqt(i) = Val(txtQtyS(i)) aname(i) = comItemName(i).Text Next cmdsave.Enabled = True cmdedit.Enabled = False End Sub

Private Sub cmdExit_Click()

Beep Unload Me End Sub

Private Sub cmdsave_Click() If temp = 1 Then For i = 0 To nr - 1 ItemRs.FindFirst "itemname='" & aname(i) & "'" ItemRs.Edit ItemRs!gqty = ItemRs!gqty + agqt(i) ItemRs!sqty = ItemRs!sqty + asqt(i) ItemRs.Update Next i saleeditrs.MoveLast nr = tRec myDB.Execute ("delete * from sale where vno='" & txtVNo.Text & " '") For i = 0 To nr SaleRs.AddNew SaleRs!vechno = txtvechNo.Text SaleRs!vno = txtVNo.Text SaleRs!Date = txtdate.Text SaleRs!custName = comcustname.Text SaleRs!Status = stay SaleRs!itemname = comItemName(i).Text SaleRs!gqty = txtQtyG(i).Text SaleRs!sqty = txtQtyS(i).Text SaleRs!Rate = txtRate(i).Text SaleRs.Update Next i For i = 0 To nr - 1 ItemRs.FindFirst "itemname='" & comItemName(i).Text & "'" ItemRs.Edit ItemRs!gqty = ItemRs!gqty - Val(txtQtyG(i)) ItemRs!sqty = ItemRs!sqty - Val(txtQtyS(i)) ItemRs.Update Next i Else

For i = 0 To tRec SaleRs.AddNew SaleRs!vno = txtVNo.Text SaleRs!vechno = txtvechNo.Text SaleRs!Date = txtdate.Text SaleRs!custName = comcustname.Text SaleRs!Status = stay SaleRs!itemname = comItemName(i).Text SaleRs!gqty = txtQtyG(i).Text SaleRs!sqty = txtQtyS(i).Text SaleRs!Rate = txtRate(i).Text SaleRs.Update Next i For i = 0 To tRec ItemRs.FindFirst "itemname='" & comItemName(i).Text & "'" ItemRs.Edit ItemRs!gqty = ItemRs!gqty - Val(txtQtyG(i)) ItemRs!sqty = ItemRs!sqty - Val(txtQtyS(i)) ItemRs.Update Next i End If cmdsave.Enabled = False cmdedit.Enabled = True End Sub

Private Sub comItemName_Click(index As Integer) ItemRs.FindFirst "itemname = '" & comItemName(index).Text & "'" txtUnit(index).Text = ItemRs!unit txtRate(index).Text = ItemRs!Rate txtAmt(index).Text = Val(txtQtyTotal(index)) * Val(txtRate(index)) txtQtyS(index).SetFocus End Sub

Private Sub Form_Load() Set SaleRs = myDB.OpenRecordset("sale", dbOpenDynaset) Set CustRs = myDB.OpenRecordset("select custname from customer", dbOpenSnapshot) Set ItemRs = myDB.OpenRecordset("item", dbOpenDynaset)

Do While Not CustRs.EOF comcustname.AddItem CustRs!custName CustRs.MoveNext Loop ItemRs.MoveFirst Do While Not ItemRs.EOF comItemName(0).AddItem ItemRs!itemname ItemRs.MoveNext Loop txtQtyTotal(0).Enabled = False txtUnit(0).Enabled = False txtAmt(0).Enabled = False temp = 0 cmdsave.Enabled = False frmsale.Height = 6125 frmsale.Width = 7200 frmsale.Top = 0 End Sub

Private Sub optCash_Click() lblcustname.Visible = optCredit.Value comcustname.Visible = optCredit.Value txtName.Visible = optCash.Value stay = "CASH" txtName.Text = "CASH" End Sub

Private Sub optCredit_Click() lblcustname.Visible = optCredit.Value comcustname.Visible = optCredit.Value stay = "CREDIT" txtName.Text = "CREDIT" End Sub

Private Sub Picture1_Click()

End Sub

Private Sub txtdate_Change() txtdate.Enabled = False End Sub

Private Sub txtVNo_LostFocus() SaleRs.FindFirst "VNo = '" & txtVNo.Text & "'" If SaleRs.NoMatch Then txtdate.Text = Date cmdsave.Enabled = True Else Set saleeditrs = myDB.OpenRecordset("select * from sale where vno='" & txtVNo.Text & "'") saleeditrs.MoveLast nr = saleeditrs.RecordCount saleeditrs.MoveFirst ItemRs.FindFirst "itemname ='" & saleeditrs!itemname & " ' " If saleeditrs!Status = "CREDIT" Then optCredit.Value = True Call optCredit_Click CustRs.MoveFirst Do While Not CustRs.EOF comcustname.AddItem CustRs!custName CustRs.MoveNext Loop comcustname.Text = saleeditrs!custName End If txtdate.Text = saleeditrs!Date txtvechNo.Text = saleeditrs!vechno saleeditrs.MoveFirst For i = 0 To nr - 1 loaddata (i) saleeditrs.MoveNext Next i lblgqtotal = 0 lblamttotal = 0 saleeditrs.MoveFirst For i = 0 To nr - 1

lblgqtotal = Val(lblgqtotal) + Val(txtQtyTotal(i)) lblamttotal = Val(lblamttotal) + Val(txtAmt(i)) Next t=1 End If End Sub

Private Sub loaddata(index As Integer) If index > 0 Then Load comItemName(index) Load txtQtyG(index) Load txtQtyS(index) Load txtQtyTotal(index) Load txtUnit(index) Load txtRate(index) Load txtAmt(index) Load comMore(index)

comItemName(index).Top = comItemName(index - 1).Top + 435 txtQtyG(index).Top = txtQtyG(index - 1).Top + 435 txtQtyS(index).Top = txtQtyS(index - 1).Top + 435 txtQtyTotal(index).Top = txtQtyTotal(index - 1).Top + 435 txtUnit(index).Top = txtUnit(index - 1).Top + 435 txtRate(index).Top = txtRate(index - 1).Top + 435 txtAmt(index).Top = txtAmt(index - 1).Top + 435 comMore(index).Top = comMore(index - 1).Top + 435

comItemName(index).Visible = True txtQtyG(index).Visible = True txtQtyS(index).Visible = True txtQtyTotal(index).Visible = True txtUnit(index).Visible = True txtRate(index).Visible = True txtAmt(index).Visible = True comMore(index).Visible = True ItemRs.MoveFirst Do While Not ItemRs.EOF

comItemName(index).AddItem ItemRs!itemname ItemRs.MoveNext Loop End If txtQtyS(index).Text = saleeditrs!sqty comItemName(index).Text = saleeditrs!itemname txtQtyG(index).Text = saleeditrs!gqty txtQtyTotal(index).Text = Val(txtQtyS(index)) + Val(txtQtyG(index)) ItemRs.FindFirst "itemname" = saleeditrs!itemname txtUnit(index).Text = ItemRs!unit ItemRs.FindFirst "itemname ='" & saleeditrs!itemname & "'" txtRate(index).Text = ItemRs!Rate txtAmt(index).Text = Val(txtQtyTotal(index)) * Val(txtRate(index)) comMore(index).AddItem "N" comMore(index).AddItem "Y" End Sub

Private Sub comMore_LostFocus(index As Integer) If comMore(index).Text = "Y" Then comMore(index).Enabled = False tRec = index + 1 CreatRow (tRec) End If End Sub

Private Sub txtQtyG_LostFocus(index As Integer) txtQtyTotal(index).Text = Val(txtQtyG(index)) + Val(txtQtyS(index)) txtAmt(index).Text = Val(txtQtyTotal(index)) * Val(txtRate(index)) lblgqtotal = 0 lblamttotal = 0 If t = 1 Then rec = nr - 1 Else rec = tRec End If For i = 0 To rec lblgqtotal = Val(lblgqtotal) + Val(txtQtyTotal(i))

lblamttotal = Val(lblamttotal) + Val(txtAmt(i)) Next End Sub

Private Sub CreatRow(index As Integer) If index > 5 Then For i = 0 To index - 1 comItemName(i).Top = comItemName(i).Top - 435 txtQtyG(i).Top = txtQtyG(i).Top - 435 txtQtyS(i).Top = txtQtyS(i).Top - 435 txtQtyTotal(i).Top = txtQtyTotal(i).Top - 435 txtUnit(i).Top = txtUnit(i).Top - 435 txtRate(i).Top = txtRate(i).Top - 435 txtAmt(i).Top = txtAmt(i).Top - 435 comMore(i).Top = comMore(i).Top - 435 Next vscItem.Min = vscItem.Min - 1 End If Load comItemName(index) comItemName(index).Top = comItemName(index - 1).Top + 435 ItemRs.MoveFirst Do While Not ItemRs.EOF comItemName(index).AddItem ItemRs!itemname ItemRs.MoveNext Loop comItemName(index).Visible = True Load txtQtyG(index) txtQtyG(index).Top = txtQtyG(index - 1).Top + 435 txtQtyG(index).Visible = True txtQtyG(index).Text = 0 Load txtQtyS(index) txtQtyS(index).Top = txtQtyS(index - 1).Top + 435 txtQtyS(index).Visible = True txtQtyS(index).Text = 0 Load txtQtyTotal(index) txtQtyTotal(index).Top = txtQtyTotal(index - 1).Top + 435 txtQtyTotal(index).Visible = True

txtQtyTotal(index).Text = 0 Load txtUnit(index) txtUnit(index).Top = txtUnit(index - 1).Top + 435 txtUnit(index).Visible = True txtUnit(index).Text = "" Load txtRate(index) txtRate(index).Top = txtRate(index - 1).Top + 435 txtRate(index).Visible = True txtRate(index).Text = 0 Load txtAmt(index) txtAmt(index).Top = txtAmt(index - 1).Top + 435 txtAmt(index).Visible = True txtAmt(index).Text = 0 Load comMore(index) comMore(index).Top = comMore(index - 1).Top + 435 comMore(index).Visible = True comMore(index).Text = "N" comMore(index).Enabled = True comMore(index).AddItem "N" comMore(index).AddItem "Y" comItemName(index).SetFocus End Sub

Private Sub txtQtyS_LostFocus(index As Integer) txtQtyTotal(index).Text = Val(txtQtyG(index)) + Val(txtQtyS(index)) txtAmt(index).Text = Val(txtQtyTotal(index)) * Val(txtRate(index)) lblgqtotal = 0 lblamttotal = 0 If t = 1 Then rec = nr - 1 Else rec = tRec End If For i = 0 To rec lblgqtotal = Val(lblgqtotal) + Val(txtQtyTotal(i)) lblamttotal = Val(lblamttotal) + Val(txtAmt(i)) Next

End Sub

Private Sub vscItem_Change() If tvsc > vscItem.Value Then togle = -1 Else togle = 1 End If For i = 0 To tRec comItemName(i).Top = comItemName(i).Top - 435 * togle txtQtyG(i).Top = txtQtyG(i).Top - 435 * togle txtQtyS(i).Top = txtQtyS(i).Top - 435 * togle txtQtyTotal(i).Top = txtQtyTotal(i).Top - 435 * togle txtUnit(i).Top = txtUnit(i).Top - 435 * togle txtRate(i).Top = txtRate(i).Top - 435 * togle txtAmt(i).Top = txtAmt(i).Top - 435 * togle comMore(i).Top = comMore(i).Top - 435 * togle Next 'vscItem.Max = vscItem.Max + 1 tvsc = vscItem.Value End Sub

Company record form Customer record form Dealer record form

Item record form


Meter reading form Password form
Private Sub cmdCancle_Click() Beep Unload Me End Sub

Private Sub cmdsave_Click() CompRs.Edit CompRs!CompName = txtCompName.Text CompRs!dealer = txtDealer.Text CompRs!address = txtaddress.Text CompRs!mpstno = txtMPSTNo.Text CompRs!cstno = txtCSTNo.Text CompRs.Update End Sub

Private Sub Form_Load() Set CompRs = myDB.OpenRecordset("company", dbOpenDynaset) txtCompName.Text = CompRs!CompName txtDealer.Text = CompRs!dealer txtaddress.Text = CompRs!address txtMPSTNo.Text = CompRs!mpstno txtCSTNo.Text = CompRs!cstno frmCompany.Top = 0 End Sub Option Explicit Dim n As Integer

Dim x As Object Dim tmp As Integer

Private Sub cmdAdd_Click() For Each x In frmcustomer.Controls If TypeOf x Is TextBox Then x.Text = "" End If Next cmdedit.Enabled = False cmdsave.Enabled = False tmp = 1 txtCustCode.SetFocus End Sub

Private Sub cmdedit_Click() tmp = 0 cmdsave.Enabled = True cmdAdd.Enabled = True End Sub

Private Sub cmdExit_Click() Beep Unload Me End Sub

Private Sub cmdFirst_Click() CustRs.MoveFirst loaddata cmdsave.Enabled = False End Sub

Private Sub cmdLast_Click() CustRs.MoveLast

loaddata cmdsave.Enabled = False End Sub

Private Sub cmdNext_Click() CustRs.MoveNext If CustRs.EOF() Then CustRs.MovePrevious Beep MsgBox "You Are Allready On The Last Record" Else loaddata End If cmdedit.Enabled = True cmdsave.Enabled = False End Sub

Private Sub cmdPrevious_Click() CustRs.MovePrevious If CustRs.BOF() Then CustRs.MoveNext Beep MsgBox "You Are Already On The first record" Else loaddata End If cmdedit.Enabled = True cmdsave.Enabled = False End Sub

Private Sub cmdsave_Click() If tmp > 0 Then CustRs.AddNew Else

CustRs.Edit End If CustRs!custcode = txtCustCode.Text CustRs!custName = txtCustName.Text CustRs!address = txtaddress.Text CustRs!tel = txttel.Text CustRs.Update cmdsave.Enabled = False tmp = 0 End Sub

Private Sub Form_Load() Set CustRs = myDB.OpenRecordset("customer", dbOpenDynaset) n = CustRs.RecordCount If n > 0 Then cmdsave.Enabled = False loaddata Else cmdsave.Enabled = True cmdAdd.Enabled = True cmdedit.Enabled = True cmdFirst.Enabled = False cmdLast.Enabled = False cmdPrevious.Enabled = False cmdNext.Enabled = False End If frmcustomer.Height = 3510 frmcustomer.Width = 6330 frmcustomer.Top = 0 End Sub

Private Sub loaddata() txtCustCode.Text = CustRs!custcode txtCustName.Text = CustRs!custName

txttel.Text = CustRs!tel txtaddress.Text = CustRs!address End Sub

Private Sub txtCustCode_LostFocus() CustRs.FindFirst "custcode" = txtCustCode.Text If CustRs.NoMatch Then cmdsave.Enabled = True Else loaddata cmdsave.Enabled = False cmdAdd.Enabled = True cmdedit.Enabled = True End If End Sub Option Explicit Dim x As Object Dim tmp As Integer Dim n As Integer

Private Sub cmdAdd_Click() For Each x In frmDealer.Controls If TypeOf x Is TextBox Then x.Text = "" End If Next cmdedit.Enabled = False cmdsave.Enabled = False tmp = 1 txtDealerCode.SetFocus End Sub

Private Sub cmdedit_Click() tmp = 0

cmdsave.Enabled = True cmdAdd.Enabled = True End Sub

Private Sub cmdExit_Click() Beep Unload Me End Sub

Private Sub cmdFirst_Click() DealerRs.MoveFirst loaddata cmdedit.Enabled = True cmdsave.Enabled = False

End Sub

Private Sub cmdLast_Click() DealerRs.MoveLast loaddata cmdedit.Enabled = True cmdsave.Enabled = False End Sub

Private Sub cmdNext_Click() DealerRs.MoveNext If DealerRs.EOF() Then DealerRs.MovePrevious Beep MsgBox ("You all rsady on Last Record") Else loaddata End If cmdedit.Enabled = True

cmdsave.Enabled = False End Sub

Private Sub cmdPrevious_Click() DealerRs.MovePrevious If DealerRs.BOF() Then DealerRs.MoveNext Beep MsgBox ("You are allready on First Record") Else loaddata End If cmdedit.Enabled = True cmdsave.Enabled = False End Sub

Private Sub cmdsave_Click() If tmp = 0 Then DealerRs.Edit Else DealerRs.AddNew DealerRs!dealercode = txtDealerCode.Text End If DealerRs!dealername = txtDealerName.Text DealerRs!address = txtaddress.Text DealerRs!tel = txttel.Text DealerRs!fax = txtFax.Text DealerRs!e_mail = txtE_Mail.Text DealerRs!contperson = txtcontPerson.Text DealerRs.Update cmdsave.Enabled = False End Sub

Private Sub Form_Load()

Set DealerRs = myDB.OpenRecordset("dealer", dbOpenDynaset) n = DealerRs.RecordCount If n > 0 Then cmdsave.Enabled = False loaddata Else cmdsave.Enabled = False cmdedit.Enabled = False cmdAdd.Enabled = True cmdFirst.Enabled = False cmdLast.Enabled = False cmdNext.Enabled = False cmdPrevious.Enabled = False End If frmDealer.Height = 5300 frmDealer.Width = 6000 frmDealer.Top = 0 End Sub

Private Sub loaddata() txtDealerCode.Text = DealerRs!dealercode txtDealerName.Text = DealerRs!dealername txtaddress.Text = DealerRs!address txttel.Text = DealerRs!tel txtE_Mail.Text = DealerRs!e_mail txtFax.Text = DealerRs!fax txtcontPerson.Text = DealerRs!contperson End Sub

Private Sub txtDealerCode_LostFocus() DealerRs.FindFirst "dealercode = '" & txtDealerCode.Text & "' " If DealerRs.NoMatch Then cmdsave.Enabled = True Else

loaddata cmdsave.Enabled = False cmdAdd.Enabled = True cmdedit.Enabled = True End If End Sub Option Explicit Dim x As Object Dim tmp As Integer Dim n As Integer

Private Sub cmdAdd_Click() For Each x In frmitem.Controls If TypeOf x Is TextBox Then x.Text = "" End If Next cmdEdit.Enabled = False cmdSave.Enabled = False tmp = 1 txtitemcode.SetFocus End Sub

Private Sub cmdedit_Click() tmp = 0 cmdSave.Enabled = True cmdAdd.Enabled = True End Sub

Private Sub cmdExit_Click() Beep Unload Me End Sub

Private Sub cmdFirst_Click() ItemRs.MoveFirst loaddata cmdEdit.Enabled = True cmdSave.Enabled = False

End Sub

Private Sub cmdLast_Click() ItemRs.MoveLast loaddata cmdEdit.Enabled = True cmdSave.Enabled = False End Sub

Private Sub cmdNext_Click() ItemRs.MoveNext If ItemRs.EOF() Then ItemRs.MovePrevious Beep MsgBox ("You all rsady on Last Record") Else loaddata End If cmdEdit.Enabled = True cmdSave.Enabled = False End Sub

Private Sub cmdPrevious_Click() ItemRs.MovePrevious If ItemRs.BOF() Then ItemRs.MoveNext Beep MsgBox ("You are allready on First Record")

Else loaddata End If cmdEdit.Enabled = True cmdSave.Enabled = False End Sub

Private Sub cmdsave_Click() If tmp = 0 Then ItemRs.Edit Else ItemRs.AddNew ItemRs!itemcode = txtitemcode.Text End If ItemRs!itemname = txtitemname.Text ItemRs!sqty = txtsqty.Text ItemRs!gqty = txtgqty.Text ItemRs!Rate = txtrate.Text ItemRs!unit = txtunit.Text ItemRs.Update cmdSave.Enabled = False End Sub

Private Sub Form_Load() Set ItemRs = myDB.OpenRecordset("item", dbOpenDynaset) n = ItemRs.RecordCount If n > 0 Then cmdSave.Enabled = False loaddata Else cmdSave.Enabled = False cmdEdit.Enabled = False cmdAdd.Enabled = True cmdFirst.Enabled = False

cmdLast.Enabled = False cmdNext.Enabled = False cmdPrevious.Enabled = False End If frmitem.Height = 4200 frmitem.Width = 4035 frmitem.Top = 0 End Sub

Private Sub loaddata() txtitemcode.Text = ItemRs!itemcode txtitemname.Text = ItemRs!itemname txtsqty.Text = ItemRs!sqty txtgqty.Text = ItemRs!gqty txtrate.Text = ItemRs!Rate txtunit.Text = ItemRs!unit End Sub

Private Sub txtitemCode_LostFocus() ItemRs.FindFirst "itemcode = '" & txtitemcode.Text & "' " If ItemRs.NoMatch Then cmdSave.Enabled = True Else loaddata cmdSave.Enabled = False cmdAdd.Enabled = True cmdEdit.Enabled = True End If Option Explicit Dim x As Object Dim tmp As Integer Dim n As Integer Dim check As Integer Private Sub cmdAdd_Click()

txtdate.Text = Date MeterRs.FindFirst "Date = #" & Format(txtdate.Text, "mm-dd-yy") & "#" If MeterRs.NoMatch Then MeterRs.MoveLast txtOpBal1.Text = MeterRs!clbal1 txtOpBal2.Text = MeterRs!clbal2 txtOpbal3.Text = MeterRs!clbal3 txtClBal1.Text = "" txtClBal2.Text = "" txtClBal3.Text = "" cmdEdit.Enabled = False cmdSave.Enabled = True tmp = 1 txtClBal1.SetFocus Else Beep MsgBox ("You Are Allready Enter closing balance ") Beep MsgBox ("You can only edit this entry by edit button") End If End Sub

Private Sub cmdedit_Click() tmp = 0 cmdSave.Enabled = True cmdAdd.Enabled = True End Sub

Private Sub cmdExit_Click() Beep Unload Me End Sub

Private Sub cmdFirst_Click()

MeterRs.MoveFirst txtOpBal1.Enabled = False txtOpBal2.Enabled = False txtOpbal3.Enabled = False txtOpBal1.Text = MeterRs!clbal1 txtOpBal2.Text = MeterRs!clbal2 txtOpbal3.Text = MeterRs!clbal3 txtClBal1.Text = MeterRs!clbal1 txtClBal2.Text = MeterRs!clbal2 txtClBal3.Text = MeterRs!clbal3 txtdate.Text = MeterRs!Date cmdEdit.Enabled = True cmdSave.Enabled = False End Sub

Private Sub cmdLast_Click() MeterRs.MoveLast txtOpBal1.Enabled = False txtOpBal2.Enabled = False txtOpbal3.Enabled = False MeterRs.MovePrevious txtOpBal1.Text = MeterRs!clbal1 txtOpBal2.Text = MeterRs!clbal2 txtOpbal3.Text = MeterRs!clbal3 MeterRs.MoveNext txtClBal1.Text = MeterRs!clbal1 txtClBal2.Text = MeterRs!clbal2 txtClBal3.Text = MeterRs!clbal3 txtdate.Text = MeterRs!Date cmdEdit.Enabled = True cmdSave.Enabled = False End Sub Private Sub cmdNext_Click() MeterRs.MoveNext

txtOpBal1.Enabled = False txtOpBal2.Enabled = False txtOpbal3.Enabled = False If MeterRs.EOF() Then MeterRs.MovePrevious Beep MsgBox ("You are allready on Last Record") Else MeterRs.MovePrevious txtOpBal1.Text = MeterRs!clbal1 txtOpBal2.Text = MeterRs!clbal2 txtOpbal3.Text = MeterRs!clbal3 MeterRs.MoveNext txtClBal1.Text = MeterRs!clbal1 txtClBal2.Text = MeterRs!clbal2 txtClBal3.Text = MeterRs!clbal3 txtdate.Text = MeterRs!Date End If cmdEdit.Enabled = True cmdSave.Enabled = False End Sub

Private Sub cmdPrevious_Click() MeterRs.MovePrevious txtOpBal1.Enabled = False txtOpBal2.Enabled = False txtOpbal3.Enabled = False If MeterRs.BOF() Then MeterRs.MoveNext Beep MsgBox ("You are allready on First Record") txtOpBal1.Text = MeterRs!opBal1 txtOpBal2.Text = MeterRs!opBal2 txtOpbal3.Text = MeterRs!opbal3

txtClBal1.Text = MeterRs!clbal1 txtClBal2.Text = MeterRs!clbal2 txtClBal3.Text = MeterRs!clbal3 txtdate.Text = MeterRs!Date Else MeterRs.MovePrevious If MeterRs.BOF Then MeterRs.MoveNext End If txtOpBal1.Text = MeterRs!clbal1 txtOpBal2.Text = MeterRs!clbal2 txtOpbal3.Text = MeterRs!clbal3 MeterRs.MoveNext txtClBal1.Text = MeterRs!clbal1 txtClBal2.Text = MeterRs!clbal2 txtClBal3.Text = MeterRs!clbal3 txtdate.Text = MeterRs!Date End If cmdEdit.Enabled = True cmdSave.Enabled = False End Sub

Private Sub cmdsave_Click() If tmp = 0 Then MeterRs.Edit Else MeterRs.AddNew MeterRs!Date = txtdate.Text End If MeterRs!opBal1 = txtOpBal1.Text MeterRs!opBal2 = txtOpBal2.Text MeterRs!opbal3 = txtOpbal3.Text MeterRs!clbal1 = txtClBal1.Text MeterRs!clbal2 = txtClBal2.Text

MeterRs!clbal3 = txtClBal3.Text MeterRs.Update cmdSave.Enabled = False End Sub

Private Sub Form_Load() Set MeterRs = myDB.OpenRecordset("meter", dbOpenDynaset) n = MeterRs.RecordCount If n > 0 Then cmdSave.Enabled = False txtOpBal1.Text = MeterRs!opBal1 txtOpBal2.Text = MeterRs!opBal2 txtOpbal3.Text = MeterRs!opbal3 txtClBal1.Text = MeterRs!clbal1 txtClBal2.Text = MeterRs!clbal2 txtClBal3.Text = MeterRs!clbal3 txtdate.Text = MeterRs!Date Else cmdSave.Enabled = False cmdEdit.Enabled = False cmdAdd.Enabled = True cmdFirst.Enabled = False cmdLast.Enabled = False cmdNext.Enabled = False cmdPrevious.Enabled = False End If txtdate.Enabled = False frmmeter.Height = 4900 frmmeter.Width = 4900 frmmeter.Top = o End Sub Private Sub Form_Load() Set passRs = myDB.OpenRecordset("password", dbOpenDynaset) passRs.MoveFirst

p1.Visible = True p2.Visible = False p3.Visible = False txtnpass = "" txtnpass.Enabled = False txtcpass = "" txtcpass.Enabled = False txtpass = "" cmdok.Enabled = False frmpasschange.Height = 4700 frmpasschange.Width = 4100 frmpasschange.Top = 0 End Sub

Private Sub txtcpass_LostFocus() If txtnpass.Text = txtcpass.Text Then cmdok.Enabled = True End If If txtnpass.Text <> txtcpass.Text Then Beep MsgBox ("Do Not Confirm Password") p1.Visible = True p2.Visible = False p3.Visible = False txtnpass = "" txtnpass.Enabled = False txtcpass = "" txtcpass.Enabled = False txtpass = "" cmdok.Enabled = False End If End Sub

Private Sub txtnpass_change()

If txtnpass.Text <> "" Then txtcpass.Enabled = True Else txtcpass.Enabled = False End If End Sub

Private Sub txtpass_Change() If txtpass.Text = passRs!Password Then txtnpass.Enabled = True txtnpass.SetFocus p1.Visible = False p2.Visible = False p3.Visible = True Else p1.Visible = False p2.Visible = True p3.Visible = False End If End Sub

Private Sub txtpass_GotFocus() p1.Visible = True p2.Visible = False p3.Visible = False End Sub

1. For Running this software first fills login form.

2. Then following blank screen appeared we can use any option. This is main MDI form.

3. This is Sale Bill form. We can select any item from it.

4. This is Purchase Bill form. We can select any item from it.

5. This is Company Information form. We can add company information in it.

6. This is Customer Information form. We can add details in it.

7. This is Dealer Information form. We can provide Info. in it.

9. This is Meter Reading form. We can check opening and closing reading daily in it.

10.This is Change Password form. We can change Password in it.

Petrol Pump 2012

BIBLIOGRAPHY

Informatics Practices (A Book of Visual Basic)

Sumita Arora

VB Black Book

Steven Holzner

Page 2

You might also like