of 121
8/2/2019 Project File Work
1/121
SOFTWARE
FOR
IN
VISUAL BASIC 6.0
A PROJECT REPORT
SUBMITTED TO
PUNJAB TECHNICAL UNIVERSITY, JALANDHAR
FOR THE PARTIAL FULFILMENT OF THE REQUIREMENTS
OF
MASTER IN COMPUTER APPLICATION LETARAL ENTRY
(UNDER DISTANCE EDUCATION PROGRAMME)
SUPERVISED BY: SUBMITTED BY:
Parminder Singh Kirandip kaurSandeep sharama
8/2/2019 Project File Work
2/121
PREFACEThe Journey of a thousand miles starts with a single step. This
project is the first milestone in the journey of our technical experience.Throughout the on going of this project, we usually got nervous but theonly thing that kept us going on were the words of Swami DayanandSaraswati.
No need of looking behind, forward!
We want infinite energy, infinite zeal
Infinite courage and infinite patience
Then only will great things be achieved
The information highway has brought an era where intricateproblems are being solved in a fraction of second. The present age isThe age of computers. The computer technology has entered intoevery walk of life. The increasing number of computers can be seenemployed in offices, hospitals, railways and a lot more places.Computers not only allow the enhancement in computation speed but
also have brought in considerable cost effectiveness.
It is important to develop a correlation between the practical andtheoretical aspects of the subject studied. It is more relevant in the field
of computers. Thus in order to test, implement and use the varioustechniques studied, this project called COMPUTER
BASED ICICI BANK SYSTEM was taken up that hasinnumerable advantages over manual system.
Barjinder SinghJatinder Singh
Prithipal Singh
8/2/2019 Project File Work
3/121
ACKNOWLEDGEMENT
THANKS TO THE ALMIGHTY FOR SHOWERING HIS BLESSINGS
Nothing concrete can be achieved without a combination of
inspiration and perspiration. Although writing a few words on a piece
of paper is not a proper way of acknowledge those people who has
helped us in the completion of this project, yet the words coming from
our heart and soul need no mode of communication.
I take the opportunity to present my vote of thanks to all those guideposts
who really acted as lighting pillars to enlighten my way throughout this project
that has led to completion of this study.
I find it a matter of honor in showering my gratitude, indebt-ness and
thankfulness to my Guide respected Prof. Parminder Singh for her utmost
interest, kind and invaluable guidance and during the project supporting me ,
gently coaxing me, giving me vital push and instilling sense of urgency whichled to successful completion of this project..
I will be failing our duties if I dont thank and acknowledge
Harbhajan Singh for providing me construction guidance, labs facility and
high moral support throughout me working phase. I debited to both for lending
their helping hand whenever the need arose, due to which this project was
possible.
I offer appreciation to our parents and friends for there willing co-
operation, encouragement, moral and financial support. I thank all the people
who helped us directly or indirectly in this project. Last but not least, I feel very
honored to complete this project as students their guidance and providing me
8/2/2019 Project File Work
4/121
8/2/2019 Project File Work
5/121
CANDIDATE DECLARATION
I swear that this project is an authentic work presented by me in
favour of PUNJAB TECHNICAL UNIVERSITY JALANDHAR.
All the information in his report is true and best to our knowledge. No
part of this project has been copied from any project presented by
someone for any degree of course.
Kirndip KaurSandip Sharma
8/2/2019 Project File Work
6/121
INDEX
--------------------------------------------------------------------------------------------------------------NO. CONTENTS
--------------------------------------------------------------------------------------------------------------
1. INFORMATION SUPPLIED BY P.S.E.B
2. PROPOSED SYSTEM
3. REQUIREMENT DETERMINATION
4. SYSTEM ANALYSIS
5. SYSTEM DESIGN
6. IMPLEMENTATION AND TESTING
7. ABOUT VISUAL BASIC 6.0
8. DATA BASE
9. FORMS
10. CODING
11. REPORTS
12. CONCLUSION
8/2/2019 Project File Work
7/121
INFORMATION
SUPPLIED
BY
PUNJAB STATE ELECTRICITY BOARD
8/2/2019 Project File Work
8/121
INTRODUCTION
8/2/2019 Project File Work
9/121
INTRODUCTION
Punjab State Electricity Board being monoplous in the distribution and
billing of electricity in Amritsar. Categories of consumers are as under:
1. Domestic Electricity Supply
2. Commercial Electricity Supply
Procedure of billing in Punjab State Electricity Board is:
These different categories of consumer are supplied bills according to
tariff. Separate tariff rates are applied for different categories of consumer. At
present billing are done both manually and through the computer. One cycle for
the purpose of billing equals two month i.e. billing is being done manually. The
various jobs like taking new reading on the previous reading, return of
completed meter books, the premises return of stubs, ledger printing and
generation of reports are sequential in nature and the sequences has to be
followed strictly.
Initially the meter reader visits the consumer to note the meter reading.
Date for reading and other information like status etc. these reading dully filled
on meter books are returned to electricity dept. next taking into account plus any
advises, which denote unusual changes, that may have come up during the due
course of time to various forms, bills for current cycle are generated. The bills
are distributed through bill distributed to the consumer at there homes.
8/2/2019 Project File Work
10/121
The consumer makes the payment vaying amount against the bill at cash
window mentioned for payment. The cash-receiving clerk at the cash window
issues the receipts for the same amount. The stubs, which contains information
like amount paid, and date are retained by the C.R.C. all the stubs are collected
and on their bases ledger generation for each consumer takes place. Then the
reports like amount collected date wise, division wise and sub division wise etc.
are generated. From various reports the summary is generated which is required
for management purpose.
PAYMENT
Payment for commercial and domestic the above rates are net. In the
event of monthly billing not being paid within the date specified in the bill, the
surcharge of 10% shall be levied on unpaid amount of the bill in the first
instance and this would further continued to be levied every year.
The best way to study the above mentioned procedure is to segregate
them into following various hands.
8/2/2019 Project File Work
11/121
SCHEDULE DOMESTIC ELECTRICITY SUPPLY
TARIFF
The rate for domestic connection is rs.1.20 per unit. This is applicable for
the entire consumption.
METER RENT
Meter rent is being charged by PSEB from the consumer. The meter rent
for domestic connection is rs.11 per month. Meter rent is not being charged
from the consumer who supply meter of his or her own.
SURCHARGE
Surcharge is being charged by P.S.E.B. it is being charged to cover up
any sudden charges in the rate of tariff. P.S.E.B. charges 10% of the total
amount from the consumer.
MISLLINOUS CHARGES
Minimum charges or sundry charges mean monthly payment.
8/2/2019 Project File Work
12/121
SCHDULE COMMERCIAL ELECTRICITY SUPPLY
TARIFF
The rate for commercial is rs.2.50 per unit. This is applicable for the
entire consumption.
METER RENT
Meter rent is being charged by PSEB from the commercial sector. The
meter rent for domestic connection is rs.15 per month. Meter rent is not being
charged from the consumer who supply meter of his or her own.
SURCHARGE
Surcharge is being charged by P.S.E.B. it is being charged to cover up
any sudden charges in the rate of tariff. P.S.E.B. charges 10% of the total
amount from the consumer.
MISLLINOUS CHARGES
Minimum charges or sundry charges mean monthly payment.
8/2/2019 Project File Work
13/121
PROPOSED
SYSTEM
8/2/2019 Project File Work
14/121
PROPOSED SYSTEM
A profound study of the existing system together with its limitations left
only computerization a viable solution. The prime reason bang that computer is
capable of processing large amount of data at high speed. Most data can be
stored in small space for years together without any trouble and can be retrieved
in few seconds. In the proposed systems we provide all necessary computer
facility for computerize billing of elec. Department.
The major advantages of the purposed system are:
1. Accuracy will be highly enhanced. This can be expected because there is
negligible chances of error in commuter computations and all manually
entered data will be check listed before use.
2. Data storage will become much easy.
3. The system being menu driven and can be used with little effort even by
strangers to computers.
4. A lot of computational burden will be off from the elec. Dept.
5. Report and bill can be made available on the time, which is must for
them.
8/2/2019 Project File Work
15/121
REQUIREMENT
DETERMINATION
8/2/2019 Project File Work
16/121
REQUIREMENT DETERMINATION
A candidate system is designed to meet the user needs. The first step of cycle
is to determine the requirement by carrying out a preliminary survey of initial
investigation. Shared complete and accurate information requirements are
essential in building computer-based info. System. Unfortunately determining
the info each user needs is a particularly difficult task. Infect it is recognized
one of the most difficult task in the system development. The info analyst
determines needs of the user and the info flow that will satisfy those needs.
There are different methods of determining requirements. These are as follows.
1. Getting info from existing system: - determining requirements from
existing system has been called the data analyses. This strategy simply
asks the user that what info is currently received and what other info is
required.
2. Asking: - this strategy obtains info from users by simply asking them
about the requirements. There are different asking methods like
brainstorming is a technique used for generating new ideas and obtaining
general info requirement.
8/2/2019 Project File Work
17/121
SYSTEMANALYSIS
8/2/2019 Project File Work
18/121
THE SYSTEM CONCEPT
The term System is derived from the Greek word System which
means an organized relationship among functioning units or components. Asystem exists because it is designed to achieve one or more objectives. A system
is an orderly grouping of interdependent component linked together according
to a plan to achieve a specific objective. The word Component may refer a
physical part, managerial steps or a sub system in a multilevel structure. System
analysis and design for the information system were founded in the general
system theory, which emphasizes a close look to all parts of a system.
In most cases, system analysts operate in a dynamic environment where
change is a way of life. To reconstruct a system the following key Elements
must be considered:-
1. Outputs and inputs.
2. Processor(s).
3. Control.
4. Feedback.
5. Environment.
6. Boundaries and interface.
OUTPUTS AND INPUTS
A major objective of a system is to produce an output that has a value to
its intended user. What ever be the nature of the output it must be in a line with
the expectations of the intended user. Inputs are the elements that enter the
system for processing.
PROCESSOR(S)
The processor is the element of a system that involves the actual
transformation of input into output.
CONTROL
8/2/2019 Project File Work
19/121
The control element guides the system. It is the decision- making sub-
system that controls the pattern of activities governing input, processing and
output.
FEEDBACK
Control in dynamic system is achieved by feedback.. Feedback measures
Output against a standard in some form of cybernetic procedure that includes
communication and control.
ENVIRONMENT
The environment is the supra-system within which an organization
operates.
BOUNDARIES AND INTERFACE
A system should be defined by its boundaries- the limits that identify its
components, processes and interrelationships when it interfaces with anothersystem.
System analysis used here is the application of the system approach to the
study and solution of the problems using computer-based system.
System thinking is integral to system interrelated interlocking
subsystem. The system approach is a way of thinking about the analysis
and a design of computer based application. It provides a frame work
visualizing the system. When a computer is introduced into an
organization, various functions and dysfunction operate on users as well
as organization. System analysis and design focus on systems, processes
and technology.
8/2/2019 Project File Work
20/121
SYSTEM ANALYSES
So the most important and critical process for the development of info
system. System analyses means probing the problem and breaking it to several
component so that a logical repackaging can be evolved. System analyses
involve survey study definition and evolution phase of the problem.
SYSTEM STUDY
Electricity Department being monopoles in the distribution and billing of elect
categorize. Its industrial consumers are
1. Large Industrial Electricity Supply
2. Small Industrial Electricity Supply
Other consumer classes are:
1. Domestic Supply
2. Commercial Supply
The system concerns with the billing of small industrial elect supply of the
above mentioned super system.
8/2/2019 Project File Work
21/121
SYSTEM DESIGN
Here logical design of system is developed. The inputs to the system design
phase are functional specification of the system and details about the computer
configuration. During this phase:
1. Logic of the program is designed, files or databases are designed and
program test plans and implementation plans are drawn up.
2. Finally an estimate of the effect of candidate system on user and
organization are documented and evaluated by the management as the
first step towards the implementation.
3. The fail report before the implementation includes procedural flow charts,
record layout, report layout and workable plane for implementing the
candidate system
8/2/2019 Project File Work
22/121
SYSTEM DESIGN
8/2/2019 Project File Work
23/121
THE SYSTEM DEVELOPMENT LIFE CYCLE
To understand system development, we need to recognize that a
candidate system that has a life cycle. System analysis and design are
keyed to the system life cycle. The stages of system development life
cycle are shown below:
Recognition of Need
Feasibility Study
Analysis
Design
Implementation
Post Implementation and Maintenance
The analyst must progress from onstage to another methodically,
answering key questions and achieving results in each stage. There can
easily be overlap during any phase of the cycle. We now describe each
of these steps.
8/2/2019 Project File Work
24/121
Hardware Requirements
1. System Pentium-II or above2. Speed 433 MHz
3. Hard Disk 2 GB
4. RAM 64 MB
5. Keyboard 108 Key
6. Printer HP 3325
7. Monitor LG
8. Floppy Disk Drive 1.44 MB
Software requirements
1. Operating System Windows 98 or higher version
2. Software Oracle 8i & VB 6.0
8/2/2019 Project File Work
25/121
IMPLEMENTATION
AND
TESTING
8/2/2019 Project File Work
26/121
IMPLEMENTATION AND TESTING PROCESSING LOGIC
By the end of detailed study of file design the following info was available:-
Objectives from the new system derived from the limitations of the
system.
A definition of the user community on the system. A logical model of the
proposed system with logical specification for each basic process at the
appropriate level of details also the various data definitions. Complete file
designing of the proposed system with a special input output formats.
ORGANISATIONAL OBJECTIVES AND SYSTEM OBJECTIVES
The organizational objectives being to add accuracy and to cut time delays in
billing and reporting plus to reduce workload of computations.
THE SYSTEM OBJECTIVES ARE CLASSIFIED AS FOLLOWS:
1. The databases should be totally exhaustive and redundancy is to be
avoided.
2. The system should be properly divided into modules so that each can be
changed according to requirement. The system has to be flexible enough
to accommodate a lot many changes feed backs expected after its
practical running.
3. All the information regarding tariff rates as applicable to various
categories are to be initialized via separate file. The numerals must be
integrated into programming modules to facilitate changes as and when
required.
8/2/2019 Project File Work
27/121
ABOUT
VISUAL BASIC 6.0
8/2/2019 Project File Work
28/121
Microsoft Visual Basic 6.0, the fastest and easiest way to createapplications for Microsoft Windows. Whether you are an experienced
professional or brand new to Windows programming, Visual Basicprovides you with a complete set of tools to simplify rapid applicationdevelopment.
So what is Visual Basic? The "Visual" part refers to the method
used to create the graphical user interface (GUI). Rather than writingnumerous lines of code to describe the appearance and location ofinterface elements, you simply add pre-built objects into place onscreen. Although writing programs can be tedious chore at times,VISUAL BASIC reduces the effort required on your part and makes
programming as simple as dragging graphic objects onto your screenwith your mouse. If you've ever used a drawing program such as Paint,you already have most of the skills necessary to create an effective user
interface.
The "Basic" part refers to the BASIC (Beginners All-PurposeSymbolic Instruction Code) language, a language used by more
programmers than any other language in the history of computing.Visual Basic has evolved from the original BASIC language and nowcontains several hundred statements, functions, and keywords, many ofwhich relate directly to the Windows GUI. Beginners can create useful
applications by learning just a few of the keywords, yet the power ofthe language allows professionals to accomplish anything that can beaccomplished using any other Windows programming language.
The Visual Basic programming language is not unique to VisualBasic. The Visual Basic programming system, Applications Editionincluded in Microsoft Excel, Microsoft Access, and many otherWindows applications uses the same language. The Visual BasicScripting Edition (VBScript) is a widely used scripting language and a
subset of the Visual Basic language.
8/2/2019 Project File Work
29/121
Whether your goal is to create a small utility for yourself or yourwork group, a large enterprise-wide system, or even distributedapplications spanning the globe via the Internet, Visual Basic has thetools you need.
Data access features allow you to create databases, front-endapplications, and scalable server-side components for most
popular database formats, including Microsoft SQL Server andother enterprise-level databases.
ActiveX technologies allow you to use the functionality providedby other applications, such as Microsoft Words word processor,
Microsoft Excel spreadsheet, and other Windows applications.You can even automate applications and objects created using theProfessional or Enterprise editions of Visual Basic.
Internet capabilities make it easy to provide access to documentsand applications across the Internet or intranet from within yourapplication, or to create Internet server applications.
Your finished application is a true .exe file that uses a Visual
Basic Virtual Machine that you can freely distribute.
8/2/2019 Project File Work
30/121
Visual Basic Editions
Visual Basic is available in three versions, each geared to meet a
specific set of development requirements.
The Visual Basic Learning edition allows programmers to easilycreate powerful applications for Microsoft Windows andWindows NT. It includes all intrinsic controls, plus grid, tab, anddata-bound controls.
The Professional edition provides computer professionals with afull-featured set of tools for developing solutions for others. It
includes all the features of the Learning edition, plus additionalActiveX controls, the Internet Information Server ApplicationDesigner, integrated Visual Database Tools and DataEnvironment, Active Data Objects, and the Dynamic HTML PageDesigner
The Enterprise edition allows professionals to create robustdistributed applications in a team setting. It includes all the
features of the Professional edition, plus Back Office tools suchas SQL Server, Microsoft Transaction Server, InternetInformation Server, Visual SourceSafe, SNA Server, and more.
8/2/2019 Project File Work
31/121
Visual Basic 6.0 has many powerful features that are required
in todays programming environment, which include features from
the previous versions. Some of these features are:
PROGRAMMING OBJECTS ANDEVENTS
Thevisual forms and objects like list boxes and radio buttons that
you use on the forms, help you to interact with the application in
order to find out the flow of the program. The forms and objects
perform a specified action when an event occurs. This is known as
event-driven programming.
A COMMON PROGRAMMING PLATFORM ACROSS
ALL MICROSOFTOFFICE APPLICATIONS
Almost all Microsoft Office applications support Visual Basic by
sharing and reusing code across applications.
NATIVE CODE COMPILATION
One of the most significant features of Visual Basic is the native
code compilation. This compilation produces code almost 20 times
faster than pseudo code compilation.
8/2/2019 Project File Work
32/121
32-BIT SUPPORT
Visual Basic supports 32-bit applications.
A QUICK AND EASY WAY TO DEVELOP APPLICATION
The tools provided by Visual Basic help you reduce development
time. It is faster to create applications using the tools available.
WIZARDS
Visual Basic includes many wizards that can automate tasks or even
automate coding. Visual Basic 6.0 has a new collection of wizards
to perform some difficult and routine tasks. Some of these are:
The Package and Deployment Wizard
The Class Builder Utility
Data Object Generator Wizard
The Add-In Designer
The Application Wizard
OBJECT TYPES
New object types, calledFile System Objects orFSO, have been
added to Visual Basic 6.0.These objects enable you to work faster
and more easily with files and directories.
FUNCTIONS
8/2/2019 Project File Work
33/121
There are fourteen additional functions in Visual Basic 6.0. All of
them deal with string data. Some of these are Cal Byname, Filter,
Format Currency, Format Date Time, Format Number & Format
Percent.
ACTIVEX FEATURES
Visual Basic allows you to migrate applications to an ActiveX
document, which enables the application to install and run from a
Web browser. Thus, the developer need not know languages like
Java or HTML. Visual Basic also enables you to create ActiveX
controls. New ActiveX controls have been added and some of the
existing controls have been enhanced in Visual Basic 6.0, which
you will learn in the sections covered later.
DATABASE ENHANCEMENTS
Earlier versions of Visual Basic used Data Access Objects (DAO)
and Remote Data Objects (RDO). Visual Basic 6.0 includes
ActiveX Data Objects (ADO) as the visual data access tool, which
will be covered in detail in a later section. Data access features
allow you to create databases and front-end applications for most
popular database formats, including Microsoft SQL Server and
other enterprise-level databases. ADO requires very little coding to
interact with a data source.
SDI/MDI/EXP1ORER-STYLE INTERFACE OPTIONS
8/2/2019 Project File Work
34/121
Visual Basic has the functionality to create single, multiple, or
Windows Explorer-style document interface applications.
AN N-TIER ARCHITECTURE
The traditional client/server architecture included two parts, also
called tiers the client and the server. Today you have n-tier
client/server, which includes more than two tiers. The applicationsusing an n-tier architecture can be divided into a minimum of three
parts, namely interface, business logic, and database functions. The
client and the server handle the processing and the middle layer
takes care of the business logic.
USER INTERFACE AND NAVIGATION
It provides a graphical interface for you to interact with the
application, view results of requests, manipulate and format the data
once it is received by the client.
BUSINESS LOGIC
This is the second tier, which captures the rules that govern the
application processing, and connects the user with the data.
DATA SERVICES
8/2/2019 Project File Work
35/121
This tier manages and provides access to application data from a
structured or an unstructured store.
QUICK EDITING, TESTING, AND DEBUGGING
The Visual Basic development environment includes extensive
editing and debugging tools.
INTERNET FEATURES
Serverside applications, responding to user requests from a
browser, can be written with the help of 115 applications. The
methods, properties, and events of every element on a Web page
can be exposed using the Dynamic HTML technology. Without
having to transfer processing to the server, this technology also
allows you to write Visual Basic codes to respond to actions on anHTML page. Applications can be easily distributed onto the Web
using the Package and Deployment Wizard. If you need to program
in a Visual Basic programming model, and not in DHTML or IIS,
you can use ActiveX documents. These can also be used when you
want to control the browser window, with all its additional parts.
You can add toolbars, menus, and scroll bars of your choice using
ActiveX controls.
Special controls that have Internet-related functionality are the
Internet Transfer Control, the Web Browser control, and the
WinSock control.
PACKAGE AND DEPLOYMENT WIZARD
8/2/2019 Project File Work
36/121
The Package and Deployment Wizard, previously called Setup Wizard,
has been enhanced to include a wider range of data access formats like
ADO, DAO, ODBC, and RDO. A Visual Basic project is compressed
into a .cab file or an executable setup program. The package can be
deployed on a distribution site, like the Internet server, or just moved to
a local or Network folder.
INTEGRATED DEVELOPMENT ENVIRONMENT
The working environment in Visual Basic is often referred to as theintegrated development environment or IDE because it integrates manydifferent functions such as design, editing, compiling, and debuggingwithin a common environment. In most traditional development tools,each of these functions would operate as a separate program, each withits own interface
INTEGRATED DEVELOPMENT ENVIRONMENT ELEMENTS
The Visual Basic integrated development environment (IDE) consistsof the following elements.
Menu Bar Context Menus
Toolbars Toolbox
Project Explorer Window Properties Window
Object Browser Form Designer
Code Editor Window Form Layout Window
Immediate, Locals, and Watch Windows
Forms, Controls, and Menus
8/2/2019 Project File Work
37/121
The first step to creating an application with Visual Basic is to createthe interface, the visual part of the application with which the user willinteract. Forms and controls are the basic building blocks used to createthe interface; they are the objects that you will work with to build yourapplication.
Forms are objects that expose properties which define their appearance,methods which define their behavior, and events which define theirinteraction with the user. By setting the properties of the form andwriting Visual Basic code to respond to its events, you customize theobject to meet the requirements of your application.
Controls are objects that are contained within form objects. Each typeof control has its own set of properties, methods and events that make itsuitable for a particular purpose. Some of the controls you can use inyour applications are best suited for entering or displaying text. Othercontrols let you access other applications and process data as if theremote application was part of your code.
Designing a Form
Form objects are the basic building blocks of a Visual Basicapplication, the actual windows with which a user interacts when theyrun the application. Forms have their own properties, events, andmethods with which you can control their appearance and behavior.
The first step in designing a form is to set its properties. You can set aform's properties at design time in the Properties window or at run time
by writing code.
Setting Form Properties
Many of a form's properties affect its physical appearance. The Captionproperty determines the text that is shown in the form's title bar; theIcon property sets the icon that is displayed when a form is minimized.The MaxButton and MinButton properties determine whether the formcan be maximized or minimized. By changing the BorderStyle
property, you can control the resizing behavior of the form.
8/2/2019 Project File Work
38/121
Height and Width properties determine the initial size of a form; Leftand Top properties determine the form's location in relation to theupper left-hand corner of the screen. The WindowState property can beset to start the form in a maximized, minimized, or normal state.
The Name property sets the name by which you will refer to the formin code. By default, when a form is first added to a project, its name isset to Form1, Form2, and so forth. It's a good idea to set the Name
property to something more meaningful, such as "frmEntry" for anorder entry form.
The best way to familiarize you with the many form properties is to
experiment. Change some of the properties of a form in the Propertieswindow , then run the application to see their effect. You can learnmore about each property by selecting it and pressing F1 to view thecontext-sensitive Help.
CONTROLS
LABEL
8/2/2019 Project File Work
39/121
A Label control is a graphical control you can use to display text that auser can't change directly. You can write code that changes the textdisplayed by a Label Control in response to events at Run Time. Forexample, if your application takes a few minutes to commit a change,you can display a processing-status message in a Label. You can alsouse a Label to identify a control, such as a TextBox control, that doesn'thave its own Caption property.
Set the AutoSize and WordWrap properties if you want the Label toproperly display variable-length lines or varying numbers of lines.
TEXTBOX
To display multiple lines of text in a TextBox control, set theMultiLine property to True. If a multiple-line TextBox doesn't have ahorizontal scroll bar, text wraps automatically even when the TextBoxis resized. To customize the scroll bar combination on a TextBox, setthe ScrollBars property.
Scroll bars will always appear on the TextBox when its MultiLineproperty is set to True, and its ScrollBars property is set to anythingexcept None (0).
If you set the MultiLine property to True, you can use the Alignmentproperty to set the alignment of text within the TextBox. The text isleft-justified by default. If the MultiLine property is False, setting theAlignment property has no effect.
COMBO BOX
A combo box control combines the features of a text box and a list box.
This control allows the user to select an item either by typing text intothe combo box, or by selecting it from the list.
8/2/2019 Project File Work
40/121
Combo boxes present a list of choices to the user. If the number ofitems exceeds what can be displayed in the combo box, scroll bars willautomatically appear on the control. The user can then scroll up anddown or left to right through the list
The easiest way to allow the user to interact with an application is toprovide a button to click. You can use the command button controlprovided by Visual Basic, or you can create your own "button" using animage control containing a graphic, such as an icon.
The command button control is used to begin, interrupt, or end aprocess. When clicked, it invokes a command that has been written into
its Click event procedure.
Most Visual Basic applications have command buttons that allowthe user to simply click them to perform actions. When the userchooses the button, it not only carries out the appropriate action, it alsolooks as if it's being pushed in and released and is therefore sometimesreferred to as a push button
CHECKBOX
A CheckBox control displays an X when selected; the X disappearswhen the CheckBox is cleared. Use this control to give the user aTrue/False or Yes/No option. You can use CheckBox controls ingroups to display multiple choices from which the user can select oneor more. You can also set the value of a CheckBox programmatically
with the Value property.
CheckBox and OptionButton controls function similarly but with animportant difference: Any number of CheckBox controls on a formcan be selected at the same time. In contrast, only one OptionButtonin a group can be selected at any given time.
To display text next to the CheckBox, set the Caption property. Use
the Value property to determine the state of the controlselected,cleared, or unavailable.
8/2/2019 Project File Work
41/121
OPTION BUTTON
Option buttons present a set of two or more choices to the user. Unlikecheck boxes, however, option buttons should always work as part of agroup; selecting one option button immediately clears all the other
buttons in the group. Defining an option button group tells the user,"Here is a set of choices from which you can choose one and only one."
For example, in the option button group shown in Figure 3.11, the usercan select one of three option buttons.
FRAME
A Frame control provides an identifiable grouping for controls. Youcan also use a Frame to subdivide a form functionallyfor example,to separate groups ofOptionButton controls.
To group controls, first draw the Frame control, and then draw thecontrols inside the Frame. This enables you to move the Frame andthe controls it contains together. If you draw a control outside theFrame and then try to move it inside, the control will be on top of theFrame and you'll have to move the Frame and controls separately.
To select multiple controls in a Frame, hold down the CTRL key whileusing the mouse to draw a box around the controls.
ActiveX Controls
ActiveX controls, formerly called OLE controls, are standard userinterface elements that allow you to assemble forms and dialog boxesrapidly. ActiveX controls also bring the Internet alive, addingcompelling new functionality to World Wide Web pages.
8/2/2019 Project File Work
42/121
An ActiveX control is an extension to the Visual Basic Toolbox.You use ActiveX controls just as you would any of the standard built-incontrols, such as the CheckBox control. When you add an ActiveXcontrol to a program, it becomes part of the development and run-timeenvironment and provides new functionality for your application.
ActiveX controls leverage your capabilities as a Visual Basic programmer by retaining some familiar properties, events, andmethods, such as the Name property, which behave as you wouldexpect. Then, however, the ActiveX controls feature methods and
properties that greatly increase your flexibility and capability as aVisual Basic programmer.
For example, the Visual Basic Professional and Enterpriseeditions include the Windows Common controls that allow you tocreate applications with the look and feel of Windows 95 toolbars,status bars, and tree views of directory structures. Other controls allowyou to create applications that take full advantage of the Internet.
Visual Basic has always featured a variety of controls that you coulduse in your applications. Now you can create your own controls, for usewith Visual Basic and other development tools. With ActiveX controls,your investment in Visual Basic carries forward to the Internet.Designing an ActiveX control can be as easy as designing a VisualBasic form you can use familiar Visual Basic graphics commands to
paint your control, or create a control group using existing controls.ActiveX controls can be debugged in process, so you can step directlyfrom the code for your test form into the code for your ActiveX control
project. You can add data-binding to your Visual Basic ActiveXcontrol, so that a user can easily bind the individual fields within thecontrol to the appropriate fields in a database or other source of data.You can also use data-binding to create an ActiveX control that othercontrols can bind to, similar to the Visual Basic Data control. VisualBasic makes it easy to create polished ActiveX control packages byadding property pages, named constants, and events to your controls.You can compile your ActiveX controls directly into your applicationsexecutable, or into .ocx files that can be used with development tools
8/2/2019 Project File Work
43/121
such as Visual Basic and Microsoft Visual C++, with end user productssuch as Microsoft Office, and on the Internet.
Variables are placeholders used to store values; they have namesand data types. The data type of a variable determines how the bitsrepresenting those values are stored in the computer's memory. Whenyou declare a variable, you can also supply a data type for it. All
8/2/2019 Project File Work
44/121
variables have a data type that determines what kind of data they canstore.
By default, if you don't supply a data type, the variable is giventhe Variant data type. The Variant data type is like a chameleon itcan represent many different data types in different situations. Youdon't have to convert between these types of data when assigning themto a Variant variable: Visual Basic automatically performs anynecessary conversion.
If you know that a variable will always store data of a particulartype, however, Visual Basic can handle that data more efficiently if you
declare a variable of that type. For example, a variable to store aperson's name is best represented as a string data type, because a nameis always composed of characters.
Data types apply to other things besides variables. When youassign a value to a property, that value has a data type; arguments tofunctions also have data types. In fact, just about anything in VisualBasic that involves data also involves data types.
The fundamental Data Types provided by Visual Basic are listed below:
Data Types StorageSize
Range
Byte 1 Byte 0 to 255
Boolean 2 Bytes True or False
8/2/2019 Project File Work
45/121
Integer 2Bytes -32,768 to 32,767
Long(Long integer)
4 Bytes -2,147,483,648 to 2,147,483,648
Single(Single-precisionfloating-point)
4 Bytes -3.402823E38 to -1.401298E-45(for negative values) and 1.401298E-45 to3.402823E38(for Positive values
Double(Double-precisionfloating-point)
8 Bytes -1.79769313486232E308 to4.94065645841247E-324 (for negativevalues) and 4.94065645841247E-324 to1.79769313486232E308
Currency 8 Bytes -922,337,203,685,477.5808 to
922,337,203,685,477.5807Date 8 Bytes January 1, 100 to December 31, 9999
Object 4 Bytes Any Object Reference
String(Variable Length)
10 Bytes +Length ofString
0 to approximately 2 Billion
String
(Fixed Length)
Length of
String
1 to approximately 65,400
Variant(With Numbers)
16 Bytes Any numeric value up to a Double value
Variant(With Characters)
22 Bytes +Length ofString
Same range as a variable length string
OLE_COLOR 4 Bytes Is treated as a Long variable internally
Converting Data Types
Visual Basic provides several conversion functions you can use toconvert values into a specific data type. To convert a value to Currency,for example, you use the CCur function:
Conversion function Converts an expression to
Cbool Boolean
Cbyte Byte
8/2/2019 Project File Work
46/121
Ccur Currency
Cdate Date
CDbl Double
Cint Integer CLng Long
CSng Single
CStr String
Cvar Variant
CVErr Error
Values passed to a conversion function must be valid for thedestination data type or an error occurs. For example, if you attempt toconvert a Long to an Integer, the Long must be within the valid rangefor the Integer data type.
ACCESSING DATA USING VISUAL BASIC
The figure below is a roadmap of data access technologies found inVisual Basic.
8/2/2019 Project File Work
47/121
In Visual Basic, three data access interfaces are available to you:ActiveX Data Objects (ADO), Remote Data Objects (RDO), and DataAccess Objects (DAO). A data access interface is an object model thatrepresents various facets of accessing data. Using Visual Basic, you can
programmatically control the connection, statement builders, andreturned data for use in any application.
Why there are three data access interfaces in Visual Basic? Data access
technology is constantly evolving, and each of the three interfacesrepresents a different state of the art. The latest is ADO, which featuresa simpler yet more flexible object model than either RDO orDAO. For new projects, you should use ADO as your data accessinterface.
8/2/2019 Project File Work
48/121
DATA BASE
8/2/2019 Project File Work
49/121
8/2/2019 Project File Work
50/121
8/2/2019 Project File Work
51/121
8/2/2019 Project File Work
52/121
8/2/2019 Project File Work
53/121
FORMS
8/2/2019 Project File Work
54/121
8/2/2019 Project File Work
55/121
8/2/2019 Project File Work
56/121
8/2/2019 Project File Work
57/121
8/2/2019 Project File Work
58/121
8/2/2019 Project File Work
59/121
8/2/2019 Project File Work
60/121
8/2/2019 Project File Work
61/121
8/2/2019 Project File Work
62/121
8/2/2019 Project File Work
63/121
8/2/2019 Project File Work
64/121
CODING
8/2/2019 Project File Work
65/121
Password Form
Dim X As Integer
Private Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii = 13 ThenText2.SetFocusEnd IfEnd Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 ThenText2.Text = LCase(Text2.Text)If Text2.Text = "confidential" ThenMsgBox "Access granted " + Text1.Text, vbInformation,"Message"Unload frmpasswordLoad frmchoosefrmchoose.Show
ElseMsgBox "Invalid password " + Text1.Text, vbCritical,"Message"Text2.Text = ""X = X + 1End IfIf X = 3 ThenMsgBox "Sorry " + Text1.Text + " three trials only",
vbInformation, "Message"EndEnd If
End IfEnd Sub
8/2/2019 Project File Work
66/121
Choose Form
Private Sub Command1_Click()On Error Resume NextUnload frmchooseLoad frmbillingfrmbilling.ShowEnd Sub
Private Sub Command1_MouseMove(Button As Integer, Shift
As Integer, X As Single, Y As Single)On Error Resume NextCommand1.BackColor = &HC0FFFFEnd Sub
Private Sub Command2_Click()On Error Resume NextLoad frmapplservfrmapplserv.Show 1End Sub
Private Sub Command2_MouseMove(Button As Integer, ShiftAs Integer, X As Single, Y As Single)On Error Resume NextCommand2.BackColor = &HC0FFFFEnd Sub
Private Sub Command3_Click()On Error Resume NextOLE1.DoVerb 1End Sub
Private Sub Command3_MouseMove(Button As Integer, ShiftAs Integer, X As Single, Y As Single)On Error Resume Next
8/2/2019 Project File Work
67/121
Command3.ForeColor = &HC0FFFFEnd Sub
Private Sub Command4_Click()On Error Resume NextLoad frmmapsfrmmaps.ShowEnd Sub
Private Sub Command4_MouseMove(Button As Integer, ShiftAs Integer, X As Single, Y As Single)On Error Resume Next
Command4.BackColor = &HC0FFFFEnd Sub
Private Sub Command5_MouseMove(Button As Integer, ShiftAs Integer, X As Single, Y As Single)On Error Resume NextCommand5.BackColor = &HC0FFFFEnd Sub
Private Sub Command6_Click()On Error Resume NextUnload frmchooseLoad frmdisconnectfrmdisconnect.ShowEnd Sub
Private Sub Command6_MouseMove(Button As Integer, ShiftAs Integer, X As Single, Y As Single)On Error Resume NextCommand6.BackColor = &HC0FFFFEnd Sub
Private Sub Form_MouseMove(Button As Integer, Shift AsInteger, X As Single, Y As Single)
Command1.BackColor = &H8000000F
8/2/2019 Project File Work
68/121
Command2.BackColor = &H8000000FCommand3.ForeColor = vbBlackCommand4.BackColor = &H8000000FCommand5.BackColor = &H8000000FCommand6.BackColor = &H8000000FEnd Sub
Private Sub Label10_Click()On Error Resume NextOLE1.DoVerb 1End Sub
Private Sub Image4_Click(Index As Integer)On Error Resume NextCommand3_ClickEnd Sub
Private Sub Timer1_Timer()
On Error Resume NextLabel6.Caption = TimeEnd Sub
Private Sub Command5_Click()On Error Resume NextLoad frmallfrmall.Show 1
End Sub
8/2/2019 Project File Work
69/121
Billing Form
Option Explicit
Dim f
Private Sub cmddisabled_Click()On Error Resume NextText1.Enabled = FalseText2.Enabled = FalseText3.Enabled = FalseText4.Enabled = False
Text5.Enabled = FalseText6.Enabled = FalseText7.Enabled = FalseText8.Enabled = FalseText9.Enabled = FalseText10.Enabled = FalseText14.Enabled = False
End Sub
Private Sub cmdenabled_Click()On Error Resume NextText2.Enabled = TrueText3.Enabled = TrueText4.Enabled = TrueText5.Enabled = TrueText6.Enabled = TrueText7.Enabled = TrueText9.Enabled = TrueText10.Enabled = TrueText14.Enabled = TrueEnd Sub
Private Sub Form_Load()Data1.DatabaseName = App.Path + "\dbbilling.mdb"Data2.DatabaseName = App.Path + "\Counter.mdb"
8/2/2019 Project File Work
70/121
Toolbar1.Buttons(2).Enabled = FalseText1.Enabled = FalseText2.Enabled = FalseText3.Enabled = FalseText4.Enabled = FalseText5.Enabled = FalseText6.Enabled = FalseText7.Enabled = FalseText8.Enabled = FalseText9.Enabled = FalseText10.Enabled = FalseText11.Enabled = False
Text12.Enabled = FalseText13.Enabled = FalseText14.Enabled = Falsetxtbill.Enabled = FalseEnd Sub
Private Sub Form_QueryUnload(Cancel As Integer,UnloadMode As Integer)
On Error Resume NextIf Text2.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"Cancel = TrueElseIf MsgBox("Close Bil ling?", vbYesNo + vbQuestion,"Message") = vbNo ThenCancel = True
ElseLoad frmchoosefrmchoose.ShowCancel = FalseEnd IfEnd IfEnd Sub
Private Sub mnuclac_Click()
8/2/2019 Project File Work
71/121
On Error Resume NextDim rayray = Shell("C:\WINDOWS\CALC.EXE", 1)End Sub
Private Sub mnuclose_Click()
End Sub
Private Sub mnudelete_Click()On Error Resume NextIf Text1.Enabled = True Then
MsgBox "Save record first", vbInformation, "Message"ElseIf Text1.Text = "" ThenMsgBox "There are no record to delete", vbInformation,"Message"ElseIf Text1.Text = "01" Or Text1.Text = "02" Or Text1.Text ="03" Or Text1.Text = "04" Or Text1.Text = "05" Or Text1.Text= "06" Or Text1.Text = "07" Or Text1.Text = "08" Or
Text1.Text = "09" Or Text1.Text = "10" ThenMsgBox "Bill ID number is being used by this system viewmap for information", vbCritical, "Message"ElseIf MsgBox("Delete this record?", vbYesNo + vbQuestion,"Message") = vbYes ThenData1.Recordset.DeleteData1.Recordset.MoveNext
Load frmdeletefrmdelete.Show 1End IfEnd IfEnd If
End Sub
Private Sub mnuedit_Click()
8/2/2019 Project File Work
72/121
On Error Resume NextIf txtstatus .Text = "Disconnected" ThenMsgBox "Cannot edit Bill ID number status disconnected",vbCritical, "Message"ElseData1.Recordset.Editmnunew.Enabled = Falsemnuedit.Enabled = Falsemnusave.Enabled = TrueToolbar1.Buttons(5).Enabled = FalseToolbar1.Buttons(4).Enabled = FalseToolbar1.Buttons(2).Enabled = True
cmdenabled_ClickText2.SetFocusEnd IfEnd Sub
Private Sub mnufind_Click()On Error Resume NextIf Text1.Enabled = True Then
MsgBox "Save record first", vbInformation, "Message"ElseDim ff = InputBox("Input Bill ID No. or Family name", "Find")If f "" ThenData1.RecordSource = ("select * from tblebill whereServiceIDNo = '" & f + "' or FamilyName= '" & f + "'")Data1.Refresh
End IfIf Text1.Text = "" ThenMsgBox "Record does not exist", vbInformation, "Message"Data1.RecordSource = "select * from tblebill whereServiceIDNo '""'"Data1.RefreshEnd IfEnd If
End Sub
8/2/2019 Project File Work
73/121
Private Sub mnunew_Click()On Error Resume NextDim nn = InputBox("Please supply password or type 'cancel' toundo", "Message")n = LCase(n)If n = "confidential" ThenData1.Recordset.AddNewmnunew.Enabled = Falsemnuedit.Enabled = Falsemnusave.Enabled = True
Toolbar1.Buttons(5).Enabled = FalseToolbar1.Buttons(4).Enabled = FalseToolbar1.Buttons(2).Enabled = Truetxtstudnoctr.Text = Val(txtstudnoctr.Text) + 1Text1.Text = Format$(txtstudnoctr.Text, "00")cmdenabled_Clicktxtstatus.Text = "Connected"Text2.SetFocus
ElseIf n = "cancel" ThenMsgBox "Adding new service ID number cancel",vbInformation, "Message"ElseIf n = "" Then'do nothingElseMsgBox "Invalid password", vbCritical, "Message"mnunew_Click
End IfEnd Sub
Private Sub mnupreview_Click()On Error Resume NextIf Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"Else
8/2/2019 Project File Work
74/121
DataEnvironment1.Commands(1).CommandText = "Select *from tblebill where ServiceIDNo = '" & Text1.Text & "' "DataEnvironment1.Commands(1).Execute
Load DataReport1DataReport1.Show 1DataEnvironment1.rsCommand1.CloseEnd If
End Sub
Private Sub mnuprint_Click()
On Error Resume NextIf Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"ElseDataEnvironment1.Commands(1).CommandText = "Select *from tblebill where ServiceIDNo = '" & Text1.Text & "' "DataEnvironment1.Commands(1).Execute
DataReport1.PrintReport CommonDialog1.Copies
DataEnvironment1.rsCommand1.CloseEnd IfEnd Sub
Private Sub mnusave_Click()On Error Resume Next
Data1.Recordset.UpdateText11.Text = Val(Text6.Text) * 3.4Text12.Text = Val(Text11.Text) * 0.0629Text13.Text = Val(Text6.Text) * 2.463txtbi ll.Text = Val(Text11.Text) + Val(Text12.Text) +Val(Text13.Text)txtbill.Text = Format(txtbill.Text, " .00")mnunew.Enabled = True
mnuedit.Enabled = True
8/2/2019 Project File Work
75/121
mnusave.Enabled = FalseToolbar1.Buttons(5).Enabled = TrueToolbar1.Buttons(4).Enabled = TrueToolbar1.Buttons(2).Enabled = Falsecmddisabled_ClickEnd Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText2.SetFocusEnd If
End Sub
Private Sub Text10_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText14.SetFocusEnd IfEnd Sub
Private Sub Text14_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText6.SetFocusEnd IfEnd Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText3.SetFocusEnd IfEnd Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
8/2/2019 Project File Work
76/121
On Error Resume NextIf KeyAscii = 13 ThenText4.SetFocusEnd IfEnd Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText5.SetFocusEnd If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText10.SetFocusEnd If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText7.SetFocusEnd IfEnd Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText9.SetFocusText8.Text = Text14.TextEnd If
End Sub
8/2/2019 Project File Work
77/121
Private Sub Text8_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText9.SetFocusEnd IfEnd Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)On Error Resume Next
If KeyAscii = 13 ThenText11.Text = Val(Text6.Text) * 3.4Text12.Text = Val(Text11.Text) * 0.0629Text13.Text = Val(Text6.Text) * 2.463txtbi ll.Text = Val(Text11.Text) + Val(Text12.Text) +Val(Text13.Text)txtbill.Text = Format(txtbill.Text, " .00")End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button AsMSComctlLib.Button)On Error Resume NextSelect Case Button.KeyCase "tnew"mnunew_Click
Case "tedit"mnuedit_Click
Case "tsave"mnusave_Click
Case "tdelete"
mnudelete_Click
8/2/2019 Project File Work
78/121
Case "tfirst"If Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"ElseData1.Recordset.MoveFirstMsgBox "First record", vbInformation, "Message"End If
Case "tprevious"If Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"
ElseData1.Recordset.MovePreviousIf Data1.Recordset .BOF = True ThenMsgBox "First record already", vbInformation, "Message"End IfEnd If
Case "tnext"
If Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"ElseData1.Recordset.MoveNextIf Data1.Recordset .EOF = True ThenMsgBox "Last record already", vbInformation, "Message"End IfEnd If
Case "tlast"If Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"ElseData1.Recordset.MoveLastMsgBox "Last record", vbInformation, "Message"End If
8/2/2019 Project File Work
79/121
Case "tfind"mnufind_Click
Case "tpreview"mnupreview_Click
Case "tprint"mnuprint_Click
End Select
End Sub
8/2/2019 Project File Work
80/121
Service Application
Private Sub cmddisabled_Click()
On Error Resume Nexttxtdate.Enabled = FalseText1.Enabled = FalseText2.Enabled = FalseText3.Enabled = FalseText4.Enabled = FalseText5.Enabled = FalseText6.Enabled = FalseText7.Enabled = FalseText8.Enabled = FalseText9.Enabled = FalseText10.Enabled = FalseText11.Enabled = FalseText12.Enabled = FalseText13.Enabled = FalseText14.Enabled = FalseText15.Enabled = FalseText16.Enabled = FalseText17.Enabled = FalseText18.Enabled = FalseText19.Enabled = FalseText20.Enabled = FalseText21.Enabled = FalseText22.Enabled = FalseText23.Enabled = FalseText24.Enabled = FalseText25.Enabled = FalseText26.Enabled = FalseText27.Enabled = FalseText28.Enabled = FalseText29.Enabled = FalseText30.Enabled = False
Check1.Enabled = False
8/2/2019 Project File Work
81/121
Check2.Enabled = FalseCheck3.Enabled = FalseCheck4.Enabled = FalseCheck5.Enabled = FalseCheck6.Enabled = FalseCheck7.Enabled = False
Combo1.Enabled = FalseCombo2.Enabled = FalseCombo3.Enabled = FalseCombo4.Enabled = FalseCombo5.Enabled = False
End Sub
Private Sub cmdenabled_Click()On Error Resume Nexttxtdate.Enabled = TrueText1.Enabled = TrueText2.Enabled = TrueText3.Enabled = True
Text4.Enabled = TrueText5.Enabled = TrueText6.Enabled = TrueText7.Enabled = TrueText8.Enabled = TrueText9.Enabled = TrueText10.Enabled = TrueText11.Enabled = True
Text12.Enabled = TrueText13.Enabled = TrueText14.Enabled = TrueText15.Enabled = TrueText16.Enabled = TrueText17.Enabled = TrueText18.Enabled = TrueText19.Enabled = True
Text20.Enabled = True
8/2/2019 Project File Work
82/121
Text21.Enabled = TrueText22.Enabled = TrueText23.Enabled = TrueText24.Enabled = TrueText25.Enabled = TrueText26.Enabled = TrueText27.Enabled = TrueText28.Enabled = TrueText29.Enabled = TrueText30.Enabled = True
Check1.Enabled = True
Check2.Enabled = TrueCheck3.Enabled = TrueCheck4.Enabled = TrueCheck5.Enabled = TrueCheck6.Enabled = TrueCheck7.Enabled = TrueCombo1.Enabled = TrueCombo2.Enabled = True
Combo3.Enabled = TrueCombo4.Enabled = TrueCombo5.Enabled = TrueEnd Sub
Private Sub Combo1_Click()On Error Resume NextText11.SetFocus
End Sub
Private Sub Combo2_Click()On Error Resume NextText12.SetFocusEnd Sub
Private Sub Combo3_Click()
On Error Resume Next
8/2/2019 Project File Work
83/121
8/2/2019 Project File Work
84/121
Text23.Enabled = FalseText24.Enabled = FalseText25.Enabled = FalseText26.Enabled = FalseText27.Enabled = FalseText28.Enabled = FalseText29.Enabled = FalseText30.Enabled = False
Check1.Enabled = FalseCheck2.Enabled = FalseCheck3.Enabled = False
Check4.Enabled = FalseCheck5.Enabled = FalseCheck6.Enabled = FalseCheck7.Enabled = False
Combo1.Enabled = FalseCombo2.Enabled = FalseCombo3.Enabled = False
Combo4.Enabled = FalseCombo5.Enabled = False
Toolbar1.Buttons(2).Enabled = FalseData1.DatabaseName = App.Path + "\dbservice.mdb"
Combo1.AddItem "Residential"Combo1.AddItem "Streetlight"
Combo1.AddItem "Business"
Combo2.AddItem "New Sevice"Combo2.AddItem "Add'l Load"Combo2.AddItem "Streetlight"Combo2.AddItem "Daep/Rep"Combo2.AddItem "Sepn of Serv"Combo2.AddItem "Subdivision"
Combo2.AddItem "Temporary"
8/2/2019 Project File Work
85/121
Combo2.AddItem "Relocation/Removal"Combo2.AddItem "Others"Combo3.AddItem "Package 1"Combo3.AddItem "Package 2"Combo3.AddItem "Package 3"Combo4.AddItem "Serv Addr."Combo4.AddItem "Diff Addr."Combo5.AddItem "Serv Addr."Combo5.AddItem "Diff Addr."End Sub
Private Sub Form_QueryUnload(Cancel As Integer,
UnloadMode As Integer)On Error Resume NextIf Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"Cancel = TrueElseIf MsgBox("Close service application?", vbYesNo +vbQuestion, "Message") = vbNo Then
Cancel = TrueElseCancel = FalseEnd IfEnd IfEnd Sub
Private Sub mnudelete_Click()
On Error Resume NextIf Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"ElseIf Text25.Text = "" ThenMsgBox "No account name to delete", vbInformation,"Message"ElseIf MsgBox("Delete this record?", vbYesNo + vbQuestion,
"Message") = vbYes Then
8/2/2019 Project File Work
86/121
Data1.Recordset.DeleteData1.Recordset.MoveNextLoad frmdeletefrmdelete.Show 1End IfEnd If
End Sub
Private Sub mnuedit_Click()On Error Resume NextData1.Recordset.Edit
mnunew.Enabled = Falsemnuedit.Enabled = Falsemnusave.Enabled = TrueToolbar1.Buttons(4).Enabled = FalseToolbar1.Buttons(5).Enabled = FalseToolbar1.Buttons(2).Enabled = Truecmdenabled_ClickEnd Sub
Private Sub mnufind_Click()On Error Resume Nextf = InputBox("Input account name", "Find")If f "" ThenData1.RecordSource = ("select * from tbleservice where name= '" & f + "'")Data1.Refresh
ElseIf f = "" Then'do nothingEnd IfIf Text25.Text = "" ThenMsgBox "Account name do not exist", vbInformation,"Message"Data1.RecordSource = "select * from tbleservice where name '""'"
Data1.Refresh
8/2/2019 Project File Work
87/121
End IfEnd Sub
Private Sub mnunew_Click()On Error Resume NextData1.Recordset.AddNewmnunew.Enabled = Falsemnuedit.Enabled = Falsemnusave.Enabled = TrueToolbar1.Buttons(4).Enabled = FalseToolbar1.Buttons(5).Enabled = FalseToolbar1.Buttons(2).Enabled = True
cmdenabled_ClickText1.SetFocusEnd Sub
Private Sub mnusave_Click()On Error Resume NextIf Text25.Text = "" ThenMsgBox "Please input account name", vbInformation,
"Message"Text25.SetFocusElseIf txtdate.Text = "" ThenMsgBox "Please input target date", vbInformation, "Message"txtdate.SetFocusElselblapplied = Text31.TextData1.Recordset.Update
mnunew.Enabled = Truemnuedit.Enabled = Truemnusave.Enabled = FalseToolbar1.Buttons(5).Enabled = TrueToolbar1.Buttons(4).Enabled = TrueToolbar1.Buttons(2).Enabled = Falsecmddisabled_ClickEnd If
End Sub
8/2/2019 Project File Work
88/121
Private Sub mnustandard_Click()On Error Resume NextIf Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"ElseLoad frmstandardloadfrmstandardload.Show 1End IfEnd Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
On Error Resume NextIf KeyAscii = 13 ThenText2.SetFocusEnd IfEnd Sub
Private Sub Text10_KeyPress(KeyAscii As Integer)On Error Resume Next
If KeyAscii = 13 ThenText11.SetFocusEnd IfEnd Sub
Private Sub Text11_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 Then
Text12.SetFocusEnd IfEnd Sub
Private Sub Text12_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText13.SetFocus
End If
8/2/2019 Project File Work
89/121
End Sub
Private Sub Text13_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText14.SetFocusEnd IfEnd Sub
Private Sub Text14_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 Then
Text15.SetFocusEnd IfEnd Sub
Private Sub Text15_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText16.SetFocus
End IfEnd Sub
Private Sub Text16_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText17.SetFocusEnd If
End Sub
Private Sub Text17_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText18.SetFocusEnd IfEnd Sub
8/2/2019 Project File Work
90/121
Private Sub Text18_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 Thentxtdate.SetFocusEnd IfEnd Sub
Private Sub Text19_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText20.SetFocusEnd If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText3.SetFocusEnd IfEnd Sub
Private Sub Text20_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText21.SetFocusEnd IfEnd Sub
Private Sub Text21_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText22.SetFocusEnd IfEnd Sub
Private Sub Text22_KeyPress(KeyAscii As Integer)
On Error Resume Next
8/2/2019 Project File Work
91/121
If KeyAscii = 13 ThenText23.SetFocusEnd IfEnd Sub
Private Sub Text23_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText24.SetFocusEnd IfEnd Sub
Private Sub Text24_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText25.SetFocusEnd IfEnd Sub
Private Sub Text25_KeyPress(KeyAscii As Integer)
On Error Resume NextIf KeyAscii = 13 ThenText26.SetFocusEnd IfEnd Sub
Private Sub Text26_KeyPress(KeyAscii As Integer)On Error Resume Next
If KeyAscii = 13 ThenText27.SetFocusEnd IfEnd Sub
Private Sub Text27_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 Then
Text28.SetFocus
8/2/2019 Project File Work
92/121
End IfEnd Sub
Private Sub Text28_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText29.SetFocusEnd IfEnd Sub
Private Sub Text29_KeyPress(KeyAscii As Integer)On Error Resume Next
If KeyAscii = 13 ThenText30.SetFocusEnd IfEnd Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 Then
Text4.SetFocusEnd IfEnd Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText5.SetFocus
End IfEnd Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText6.SetFocusEnd If
End Sub
8/2/2019 Project File Work
93/121
Private Sub Text6_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText7.SetFocusEnd IfEnd Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText8.SetFocus
End IfEnd Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText9.SetFocusEnd If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 ThenText10.SetFocusEnd IfEnd Sub
Private Sub Timer1_Timer()On Error Resume NextText31.Text = DateEnd Sub
Private Sub Toolbar1_ButtonClick(ByVal Button AsMSComctlLib.Button)
On Error Resume Next
8/2/2019 Project File Work
94/121
Select Case Button.KeyCase "tnew"mnunew_ClickCase "tdelete"mnudelete_ClickCase "tsave"mnusave_ClickCase "tedit"mnuedit_ClickCase "tfirst"If Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"
ElseData1.Recordset.MoveFirstMsgBox "First record", vbInformation, "Message"End IfCase "tprevious"If Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"Else
Data1.Recordset.MovePreviousIf Data1.Recordset .BOF = True ThenMsgBox "First record already", vbInformation, "Message"End IfEnd IfCase "tnext"If Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"
ElseData1.Recordset.MoveNextIf Data1.Recordset .EOF = True ThenMsgBox "Last record already", vbInformation, "Message"End IfEnd IfCase "tlast"If Text1.Enabled = True Then
MsgBox "Save record first", vbInformation, "Message"
8/2/2019 Project File Work
95/121
ElseData1.Recordset.MoveLastMsgBox "Last record", vbInformation, "Message"End IfCase "tstandard"mnustandard_ClickCase "tfind"mnufind_ClickEnd SelectEnd Sub
Private Sub txtdate_KeyPress(KeyAscii As Integer)
On Error Resume NextIf KeyAscii = 13 ThenText19.SetFocusEnd IfEnd Sub
8/2/2019 Project File Work
96/121
Customer Record
Option Explicit
Dim f
Private Sub Command1_Click()On Error Resume Nextf = InputBox("Input Service ID or Family name", "Find")If f "" ThenData1.RecordSource = ("select * from tblebill whereServiceIDNo = '" & f + "' or FamilyName= '" & f + "'")Data1.RefreshEnd IfEnd Sub
Private Sub Command2_Click()On Error Resume NextData1.RecordSource = ("select * from tblebill order byServiceIDNo asc")Data1.RefreshEnd Sub
Private Sub Command3_Click()On Error Resume NextDim a As Stringa = Data1.Recordset.RecordCountMsgBox ("Total record " + a), vbInformation, "Message"End Sub
Private Sub Command4_Click()On Error Resume NextData1.RecordSource = ("Select * from tblebill whereServiceIDNo ' '")Data1.RefreshEnd SubPrivate Sub Command5_Click()
On Error Resume Next
8/2/2019 Project File Work
97/121
Data1.RecordSource = ("select * from tblebill order byServiceIDNo desc")Data1.RefreshEnd Sub
Private Sub Form_Load()Data1.DatabaseName = App.Path + "\dbbilling.mdb"End Sub
Private Sub Form_QueryUnload(Cancel As Integer,UnloadMode As Integer)On Error Resume Next
If MsgBox("Exit?", vbYesNo + vbQuestion, "Message") =vbNo ThenCancel = TrueEnd IfEnd Sub
8/2/2019 Project File Work
98/121
Delete Form
Private Sub Form_Load()Animation1.Open App.Path + "\FILEDEL.AVI"Animation1.PlayEnd Sub
Private Sub Timer1_Timer()On Error Resume NextBar1.Value = Bar1.Value + 5Label1.Caption = Bar1.ValueIf Bar1.Value = 150 ThenUnload frmdeleteEnd IfEnd Sub
8/2/2019 Project File Work
99/121
Dis/Connection
Private Sub Command1_Click()On Error Resume NextIf MsgBox("Disconnect " + Text1.Text + " Bill ID no.",vbYesNo + vbQuestion, "Message") = vbYes ThenData1.Recordset.Editlblstatus.Caption = "Disconnected"Data1.Recordset.UpdateMsgBox "Service ID " + Text1.Text + " disconnected",vbInformation, "Message"End IfEnd Sub
Private Sub Command2_Click()On Error Resume NextIf MsgBox("Connect " + Text1.Text + " Bill ID no.", vbYesNo+ vbQuestion, "Message") = vbYes ThenData1.Recordset.Editlblstatus.Caption = "Connected"Data1.Recordset.UpdateMsgBox "Service ID " + Text1.Text + " connected",vbInformation, "Message"End IfEnd Sub
Private Sub Command3_Click()On Error Resume Nextf = InputBox("Input Bill ID No. or Family name", "Find")If f "" ThenData1.RecordSource = ("select * from tblebill whereServiceIDNo = '" & f + "' or FamilyName= '" & f + "'")Data1.RefreshEnd IfIf Text1.Text = "" Then
MsgBox "Record does not exist", vbInformation, "Message"
8/2/2019 Project File Work
100/121
Data1.RecordSource = "select * from tblebill whereServiceIDNo '""'"Data1.RefreshEnd IfEnd Sub
Private Sub Command4_Click()On Error Resume NextIf lblstatus.Caption = "Connected" ThenMsgBox "Cannot print Bill ID number status connected",vbCritical, "Message"Else
DataEnvironment1.Commands(1).CommandText = "Select *from tblebill where ServiceIDNo = '" & Text1.Text & "'DataEnvironment1.Commands(1).ExecuteLoad DataReport2DataReport2.Show 1DataEnvironment1.rsCommand1.CloseEnd IfEnd Sub
Private Sub Command5_Click()On Error Resume NextData1.RecordSource = "select * from tblebill whereServiceIDNo '""'"Data1.RefreshEnd Sub
Private Sub Command6_Click()On Error Resume Nextf = InputBox("Input Date", "Find")If f "" ThenData1.RecordSource = ("select * from tblebill where DueDate
= '" & f + "'")
8/2/2019 Project File Work
101/121
Data1.RefreshEnd IfIf Text1.Text = "" ThenMsgBox "Due date do not exist", vbInformation, "Message"Data1.RecordSource = "select * from tblebill whereServiceIDNo '""'"Data1.RefreshEnd IfEnd Sub
Private Sub Form_Load()Data1.DatabaseName = App.Path + "\dbbilling.mdb"
End Sub
Private Sub Form_QueryUnload(Cancel As Integer,UnloadMode As Integer)On Error Resume NextIf Text1.Enabled = True ThenMsgBox "Save record first", vbInformation, "Message"Cancel = True
ElseIf MsgBox("Exit?", vbYesNo + vbQuestion, "Message") =vbNo ThenCancel = TrueElseLoad frmchoosefrmchoose.ShowCancel = False
End IfEnd IfEnd Sub
Private Sub Timer1_Timer()On Error Resume NextIf Timer1.Interval = 1000 Thenlblstatus.FontItalic = True
Timer1.Enabled = False
8/2/2019 Project File Work
102/121
Timer2.Enabled = TrueEnd IfEnd Sub
Private Sub Timer2_Timer()On Error Resume NextIf Timer1.Interval = 1000 Thenlblstatus.FontItalic = FalseTimer2.Enabled = FalseTimer1.Enabled = TrueEnd IfEnd Sub
8/2/2019 Project File Work
103/121
MapOption ExplicitDim a
Dim X As Integer
Private Sub cmdblack_Click()On Error Resume Nexta = 0txtinput.Visible = FalseText1.ForeColor = vbWhiteText2.ForeColor = vbWhiteText3.ForeColor = vbWhiteText4.ForeColor = vbWhiteText5.ForeColor = vbWhiteEnd Sub
Private Sub cmdwhite_Click()On Error Resume Nexttxtinput.Visible = Truetxtinput.Text = ""txtinput.SetFocusText1.ForeColor = vbBlackText2.ForeColor = vbBlackText3.ForeColor = vbBlackText4.ForeColor = vbBlackText5.ForeColor = vbBlackEnd Sub
Private Sub Form_Activate()txtinput.SetFocusEnd Sub
Private Sub Form_Load()Data1.DatabaseName = App.Path + "\dbbilling.mdb"X = 0a = 0
End Sub
8/2/2019 Project File Work
104/121
Private Sub Timer1_Timer()On Error Resume NextIf fra1.Width < 2145 Thenfra1.Width = fra1.Width + 100End IfIf fra1.Height < 1965 Thenfra1.Height = fra1.Height + 100End IfIf fra1.Height >= 1965 ThenX = X + 1End IfIf X = 50 Then
Timer1.Enabled = Falsetmr1.Enabled = TrueX = 0End IfEnd Sub
Private Sub Timer10_Timer()On Error Resume Next
If fra10.Width < 2145 Thenfra10.Width = fra10.Width + 100End IfIf fra10.Height < 1965 Thenfra10.Height = fra10.Height + 100End IfIf fra10.Height >= 1965 ThenX = X + 1
End IfIf X = 50 ThenTimer10.Enabled = Falsetmr10.Enabled = TrueX = 0End IfEnd Sub
8/2/2019 Project File Work
105/121
Private Sub Timer2_Timer()On Error Resume NextIf fra2.Width < 2145 Thenfra2.Width = fra2.Width + 100End IfIf fra2.Height < 1965 Thenfra2.Height = fra2.Height + 100End IfIf fra2.Height >= 1965 ThenX = X + 1End IfIf X = 50 Then
Timer2.Enabled = Falsetmr2.Enabled = TrueX = 0End IfEnd Sub
Private Sub Timer3_Timer()On Error Resume Next
If fra3.Width < 2145 Thenfra3.Width = fra3.Width + 100End IfIf fra3.Height < 1965 Thenfra3.Height = fra3.Height + 100End IfIf fra3.Height >= 1965 ThenX = X + 1
End IfIf X = 50 ThenTimer3.Enabled = Falsetmr3.Enabled = TrueX = 0End IfEnd Sub
8/2/2019 Project File Work
106/121
Private Sub Timer4_Timer()On Error Resume NextIf fra4.Width < 2145 Thenfra4.Width = fra4.Width + 100End IfIf fra4.Height < 1965 Thenfra4.Height = fra4.Height + 100End IfIf fra4.Height >= 1965 ThenX = X + 1End IfIf X = 50 Then
Timer4.Enabled = Falsetmr4.Enabled = TrueX = 0End IfEnd Sub
Private Sub Timer5_Timer()On Error Resume Next
If fra5.Width < 2145 Thenfra5.Width = fra5.Width + 100End IfIf fra5.Height < 1965 Thenfra5.Height = fra5.Height + 100End IfIf fra5.Height >= 1965 ThenX = X + 1
End IfIf X = 50 ThenTimer5.Enabled = Falsetmr5.Enabled = TrueX = 0End IfEnd Sub
8/2/2019 Project File Work
107/121
Private Sub Timer6_Timer()On Error Resume NextIf fra6.Width < 2145 Thenfra6.Width = fra6.Width + 100End IfIf fra6.Height < 1965 Thenfra6.Height = fra6.Height + 100End IfIf fra6.Height >= 1965 ThenX = X + 1End IfIf X = 50 Then
Timer6.Enabled = Falsetmr6.Enabled = TrueX = 0End IfEnd Sub
Private Sub Timer7_Timer()On Error Resume Next
If fra7.Width < 2145 Thenfra7.Width = fra7.Width + 100End IfIf fra7.Height < 1965 Thenfra7.Height = fra7.Height + 100End IfIf fra7.Height >= 1965 ThenX = X + 1
End IfIf X = 50 ThenTimer7.Enabled = Falsetmr7.Enabled = TrueX = 0End IfEnd SubPrivate Sub Timer8_Timer()
On Error Resume Next
8/2/2019 Project File Work
108/121
If fra8.Width < 2145 Thenfra8.Width = fra8.Width + 100End IfIf fra8.Height < 1965 Thenfra8.Height = fra8.Height + 100End IfIf fra8.Height >= 1965 ThenX = X + 1End IfIf X = 50 ThenTimer8.Enabled = Falsetmr8.Enabled = True
X = 0End IfEnd Sub
Private Sub Timer9_Timer()On Error Resume NextIf fra9.Width < 2145 Thenfra9.Width = fra9.Width + 100
End IfIf fra9.Height < 1965 Thenfra9.Height = fra9.Height + 100End IfIf fra9.Height >= 1965 ThenX = X + 1End IfIf X = 50 Then
Timer9.Enabled = Falsetmr9.Enabled = TrueX = 0End IfEnd Sub
Private Sub tmr1_Timer()On Error Resume Next
If fra1.Width > 0 Then
8/2/2019 Project File Work
109/121
fra1.Width = fra1.Width - 100End IfIf fra1.Height > 0 Thenfra1.Height = fra1.Height - 100X = X + 1End IfIf X = 50 Thencmdwhite_Clicktmr1.Enabled = FalseX = 0End IfEnd Sub
Private Sub tmr10_Timer()On Error Resume NextIf fra10.Width > 0 Thenfra10.Width = fra10.Width - 100End IfIf fra10.Height > 0 Thenfra10.Height = fra10.Height - 100
X = X + 1End IfIf X = 50 Thencmdwhite_Clicktmr10.Enabled = FalseX = 0End IfEnd Sub
Private Sub tmr2_Timer()On Error Resume NextIf fra2.Width > 0 Thenfra2.Width = fra2.Width - 100End IfIf fra2.Height > 0 Thenfra2.Height = fra2.Height - 100
X = X + 1
8/2/2019 Project File Work
110/121
End IfIf X = 50 Thencmdwhite_Clicktmr2.Enabled = FalseX = 0End IfEnd Sub
Private Sub tmr3_Timer()On Error Resume NextIf fra3.Width > 0 Thenfra3.Width = fra3.Width - 100
End IfIf fra3.Height > 0 Thenfra3.Height = fra3.Height - 100X = X + 1End IfIf X = 50 Thencmdwhite_Clicktmr3.Enabled = False
X = 0End IfEnd Sub
Private Sub tmr4_Timer()On Error Resume NextIf fra4.Width > 0 Thenfra4.Width = fra4.Width - 100
End IfIf fra4.Height > 0 Thenfra4.Height = fra4.Height - 100X = X + 1End IfIf X = 50 Thencmdwhite_Clicktmr4.Enabled = False
X = 0
8/2/2019 Project File Work
111/121
End IfEnd Sub
Private Sub tmr5_Timer()On Error Resume NextIf fra5.Width > 0 Thenfra5.Width = fra5.Width - 100End IfIf fra5.Height > 0 Thenfra5.Height = fra5.Height - 100X = X + 1End If
If X = 50 Thencmdwhite_Clicktmr5.Enabled = FalseX = 0End IfEnd Sub
Private Sub tmr6_Timer()
On Error Resume NextIf fra6.Width > 0 Thenfra6.Width = fra6.Width - 100End IfIf fra6.Height > 0 Thenfra6.Height = fra6.Height - 100X = X + 1End If
If X = 50 Thencmdwhite_Clicktmr6.Enabled = FalseX = 0End IfEnd Sub
Private Sub tmr7_Timer()
On Error Resume Next
8/2/2019 Project File Work
112/121
If fra7.Width > 0 Thenfra7.Width = fra7.Width - 100End IfIf fra7.Height > 0 Thenfra7.Height = fra7.Height - 100X = X + 1End IfIf X = 50 Thencmdwhite_Clicktmr7.Enabled = FalseX = 0End If
End Sub
Private Sub tmr8_Timer()On Error Resume NextIf fra8.Width > 0 Thenfra8.Width = fra8.Width - 100End IfIf fra7.Height > 0 Then
fra8.Height = fra8.Height - 100X = X + 1End IfIf X = 50 Thencmdwhite_Clicktmr8.Enabled = FalseX = 0End If
End Sub
Private Sub tmr9_Timer()On Error Resume NextIf fra9.Width > 0 Thenfra9.Width = fra9.Width - 100End IfIf fra7.Height > 0 Then
fra9.Height = fra9.Height - 100
8/2/2019 Project File Work
113/121
X = X + 1End IfIf X = 50 Thencmdwhite_Clicktmr9.Enabled = FalseX = 0End IfEnd Sub
Private Sub txtinput_KeyPress(KeyAscii As Integer)On Error Resume NextIf KeyAscii = 13 Then
Dim ff = txtinput.Textf = LCase(f)If f = "highest" Thena = 1Data1.RecordSource = "select * from tblebill whereServiceIDNo between '" & "01" & "' and '" & "10" & "' order
by val(Bill) desc"
Data1.RefreshElseIf f = "lowest" Thena = 1Data1.RecordSource = "select * from tblebill whereServiceIDNo between '" & "01" & "' and '" & "10" & "' order
by val(Bill) asc"Data1.RefreshElseIf f = "exit" Then
a = 0Unload frmmapsElseMsgBox "Please input Higest or Lowest to view bill or 'Exit'to cancel", vbCritical, "Message"a = 0txtinput.Text = ""txtinput.SetFocus
End If
8/2/2019 Project File Work
114/121
If a = 1 ThenIf Text1.Text = "01" Thencmdblack_ClickTimer1.Enabled = TrueElseIf Text1.Text = "02" Thencmdblack_ClickTimer2.Enabled = TrueElseIf Text1.Text = "03" Thencmdblack_ClickTimer3.Enabled = TrueElseIf Text1.Text = "04" Thencmdblack_Click
Timer4.Enabled = TrueElseIf Text1.Text = "05" Thencmdblack_ClickTimer5.Enabled = TrueElseIf Text1.Text = "06" Thencmdblack_ClickTimer6.Enabled = TrueElseIf Text1.Text = "07" Then
cmdblack_ClickTimer7.Enabled = TrueElseIf Text1.Text = "08" Thencmdblack_ClickTimer8.Enabled = TrueElseIf Text1.Text = "09" Thencmdblack_ClickTimer9.Enabled = True
ElseIf Text1.Text = "10" Thencmdblack_ClickTimer10.Enabled = TrueEnd IfEnd IfEnd IfEnd Sub
x-x-x-x-x-x-x-x
8/2/2019 Project File Work
115/121
DATA ENVIRONMENT
8/2/2019 Project File Work
116/121
8/2/2019 Project File Work
117/121
REPORTS
8/2/2019 Project File Work
118/121
8/2/2019 Project File Work
119/121
8/2/2019 Project File Work
120/121
CONCLUSION
8/2/2019 Project File Work
121/121
CONCLUSION
Computer based system is capable of processing large amount of data at a high
speed. Most data can be stored in a small space for years together without any
trouble and can be retrieved as when required in a few seconds. So, computer
based system is necessary for large processing.