Professional Documents
Culture Documents
MODEL
HIRE PURCHASE MANAGEMENT SYSTEM
for
A thesis submitted to the Graduate School in partial fulfillment of the requirements for
degree Master of Science (Information Technology)
by
This thesis presents a partial fulfillment of the requirement for a postgraduate degree
from Universiti Utara Malaysia. I agree that the university library may make it freely available
for inspection. I further agree that the permission for copying of this thesis in any manner, in
whole or in part, for scholarly purposes may be granted by my supervisor or, in their absence
by the Assistant Vice Chancellor of the College of Arts and Sciences. It is understood that any
copying or publication or use of this thesis or parts thereof for financial gain shall not be
allowed without my written permission. It is also understood that due recognition shall be
given to me and to Universiti Utara Malaysia for any scholarly use which may be made of any
material from my thesis.
Requests for permission to copy or to make other use of materials in this thesis, in
whole or in part should be addressed to:
I
ABSTRACT
This project is regarding the designing of conceptual and logical model of Hire
Purchase Management System for Hire Purchase Company. The System will use client server
system to run daily operations and able to smooth up the daily operation and reduce the operation
cost as well. Prior to the development of the system, a study has been done so that the
organization can gain real benefits from adopting a suitable Hire Purchase System. So, a
Conceptual Model of the system has been made to simulate the model to determine the
effectiveness of the system. The prototype will be developed know as Boon Motor Hire Purchase
Management System (BMHPM). BMHPM able to control on the daily Hire Purchase transaction
and also management system.
II
ACKNOWLEDGEMENTS
I would like to express my deepest gratitude to my supervisor, Prof Madya Md Zahir Bin
Mat Cha for his constructive suggestion, guidance, and consistence support during the
development of the project. I would also like to thank his continuous faith and support in me.
Without his encouragement and guidance, it will not be easy for me to reach this extend in
completion my report.
Secondly, I would like to thank all my dearest family members, especially to my parents,
brothers who have given me their full support in my study. Their full support remains the
mainstay for me in overcoming all the difficulties in completing this study. Next I would like to
thank all the lecturers who have taught me before throughout the Masters Degree course because
the knowledge they imparted have allowed me to be more knowledgeable and thus in a better
position to complete this research.
Lastly, I would like to thank all my friends who had given me support and helping me at
times of difficulties, especially thanks to Mr Ang Boon Wan who guiding me in the process of
completing this report.
III
TABLE OF CONTENTS
TITLE PAGE
PERMISSION TO USE…………………………………………………… I
ABSTRACT……………………………………………………………….. II
ACKNOWLEDGEMENTS………………………………………………. III
TABLE OF CONTENTS……………………………………………………IV
LIST OF FIGURES…………………………………………………………VI
LIST OF ABBREVIATIONS…………………………………………….. VII
CHPATER 1: INTRODUCTION………………………………………… 1
1.1 Problem Statement……………………………………………………2
1.2 Project’s Objective……………………………………………………2
1.3 Project’s Scope …………………………………………………… 3
1.4 Hardware and Software Requirement……………………………. 3
1.5 Summary………………………………………………………….. 4
IV
3.3.3 Entity Relationship Diagram……………………………… 19
3.3.4 Logical Model Design……………………………………. 20
3.3.5 Relational Model For Logical Model ..…………………... 22
3.3.6 Interface Design…………………………………………… 23
3.3.7 Database Design..…………………………………………. 32
3.4 Prototyping …………………………… ……..… ………………… 40
3.5 Conclusion of Prototyping & Testing …..………………………… 40
3.6 Implementation……………………………………………………. 41
3.7 Summary………………………………………………………….. 41
V
LIST OF FIGURES
VI
Figure 3.21 Hporno Table
Figure 3.22 hpoverdue Table
Figure 3.23 hppaytype Table
Figure 3.24 Negeri table
Figure 3.25 Poskod table
Figure 3.26 Staff table
Figure 3.27 Termcharge Table
Figure 3.28 Vehicle table
LIST OF TABLE
Table 1 Time Schedule
LIST OF ABBREVIATIONS
VII
CHAPTER 1
1.0 INTRODUCTION
Hire Purchase is a system of acquiring goods on credit whereby the seller of the goods is
regarded as the dealer, the purchaser is regarded as the hirer and the finance company as the
owner. The ownership of the goods bought on hire purchase does not pass to the hirer at the
time of the hire purchase agreement or upon delivery of the goods. The ownership of the
goods remains in the finance company until the hirer has fully settled the price agreed upon in
the hire purchase agreement.
A hire purchase agreement, commonly known as H.P. agreement, in respect of the goods
must be in writing and printed in type of a size not smaller than the type known as 10-point
Times. Any oral agreement is not a valid hire purchase agreement.
The main legislation governing the hire purchase transactions in Malaysia is the Hire
Purchase Act 1967, which came into force on 11 April 1968 after hire purchase became an
increasingly popular method of acquisition.
• invalid carriages
• motor cycles
• goods vehicles where the maximum permissible laden weight does not exceed
2,540 kilograms buses, including stage buses
The most common type of hire purchase agreement in Malaysia is for the purchase of motor
vehicle.
In this study, conceptual model will integrated into the Hire Purchase system of Boon Motor
Enterprise (Kedah) Sdn. Bhd. The company is allocating in Alor Setar. Boon Motor
Enterprise (K) Sdn. Bhd. is establishing in 1977. The main business is to sell motorcycle.
1
Beside that, Boon Motor Enterprise (K) Sdn. Bhd. also has sold accessories of motorcycle,
service motorcycle, sale second hand motorcycle.
At the moment, there is no Hire Purchase system being used in Boon Motor Enterprise
(Kedah) Sdn. Bhd. in order to manage daily business. As a result, few problems had occurred.
The manual system may give rise to some problem. Since all processes of recording data
have to do manually, the possibility of data lost is high. It is because some data may be lost
because of human carelessness, ambiguous handwriting and failing.
By using the manual system, the cost of management in long term is higher because the
company needs more stationery and furniture for keeping data. Beside that, the company
needs to hire more staff to manage all the transaction in the company.
Therefore, a tool is needed to improve the company’s services. The project aim is to provide
an alternative way to solve the company’s problem and increase the efficiency.
1.2 Objective
The Hire Purchase System is designed for a small business that desires a completely control
over the company’s transaction. The main objective of the study is to construct the
conceptual model for hire purchase management system. To achieve the main objective
below is some sub objectives.
ii. To construct the conceptual model for hire purchase management system
1.3 Scope
The Hire Purchase System is developing for Boon Motor Enterprise (Kedah) Sdn. Bhd. This
system is purposely developing for Boon Motor Enterprise which is focuses on main users,
which are staff and manager. This system is developing base on the requirement of company.
The system only can access by authorized user in the organization. In this system, we have
internal control. The administrator needs to log in to Hire Purchase System in order to
manage the system. Each staffs have different username and password that use to login to the
system. The system can make sure that only the authorized person can login to the system.
The users who use the valid username and password, can login by press enter for one time.
But, if the users using wrong username. The manager can access all function in the system,
but the staff only can access certain part of the system.
Manager Staff
Hardware Requirement
Software Requirement
Software that has been use to develop BMHPM are list as below:
1.5 Summary
Technological changing, over a relatively short period of time, has brought many companies
into the computerized system to centralize all the operating system. Since there is no any
complete computerized system in Boon Motor Enterprise (K) Sdn Bhd carried out for the hire
purchase management system, this project develops a prototype will capable to enhance the
company’s information systems integration and increases the quality of customer services.
CHAPTER 2
2.0 LITERATURE REVIEW
A Conceptual Model is a diagram of a set of relationships between certain factors that are
believed to impact or lead to a target condition (MSP Resource Portal, 2004). In other ways,
Conceptual Model represents 'concepts' (entities) and relationships between them. A
conceptual model is a formal model in which every entity being modeled in the real world
has a transparent and one-to-one correspondence to an object in the model (Gary F. Simons,
1994).
Conceptual modeling is a well known technique of data modeling, together with logical
modeling and physical modeling. The conceptual model is explicitly chosen to be
independent of implementation details, such as concurrency or data storage (Wikimedia
Foundation Inc., 2009).
The aim of Conceptual Model is to express the meaning of terms and concepts that use to
discuss the problem and to find the correct relationships between different concepts. The
conceptual model attempts to clarify the meaning of various usually ambiguous terms, and
ensure that problems with different interpretations of the terms and concepts cannot occur.
Such differing interpretations could easily cause the software projects that are based on the
interpretation of the concepts to fail (Wikimedia Foundation Inc., 2009).
Once the main concepts have been modeled, the model becomes a basis for subsequent
development of applications. The concepts of the conceptual model can be used as basis of
object-oriented design and implemented in program code, in particular as classes in object-
oriented languages.
A conceptual model can be described using various notations, such as UML or OMT for
object modelling, or IE or IDEF1X for Entity Relationship Modeling (Wikimedia Foundation
Inc., 2009). In UML notation, the conceptual model is described with a class diagram. In ER
notation, the conceptual model is described with an ER Diagram.
2.1.1 Conceptual Model in M5 Data Elements and Standards for Drug Dictionaries
However, regulators in the ICH regions and observer countries have established their own
procedures and applications with standards that differ in data format, content, language and
applied terminology (U.S Food and Drug Administration, 2009).
Due to the lack of a common and harmonized approach, both regulators and pharmaceutical
industry are confronted with the following issues:
• Lack of consistency in the use of terminology in the health care community (U.S
Food and Drug Administration, 2009).
Current Web services standards enable publishing service descriptions and finding services
on a match based on criteria such as method signatures or service category. This conceptual
model for reputation using which reputation information can be organized and shared and
service selection can be facilitated and automated (E. Michael Maximilien and Munindar P.
Singh, 2005).
A web service represents a set of functions addressing a particular domain. For instance, a
travel service might include functions to return a list of trips for a particular airline on a
specified date, time, origin and destination airport. For each service we can extract a series of
generic attributes and domain-specific attributes that apply to the service (E. Michael
Maximilien and Munindar P. Singh, 2005).
From this example and what we discussed before, it is clear that a conceptual model for the
reputation of a service must include the different categories of attributes that apply to a
service. The reputation of the service is a function of the various attributes that matters to a
specific agent. This is analogous to how various human real world services can appear to be
rated differently depending on the end user who is providing the rating (E. Michael
Maximilien and Munindar P. Singh, 2005).
For each domain, the attributes in that domain are important inputs to the overall rating and
reputation of a service. Some attributes are common across domains and some are specific to
domains. Each attribute has the following aspects.
• The value set for that attribute and it’s allowed range or enumeration. For instance, an
attribute such as failure rate or availability for a service can be expressed as a simple
percentage. The speed of service function execution could be instead a simple
bounded integer.
• The domains that this attributes belong to. For instance, is this a cross-domain
attribute or an attribute specific for a domain? And within each domain, some
attributes will be of greater importance than others—this can depend on some
standard definition of attributes for a domain.
• The weight of this attribute relative to its domain and the user preferences. This would
determine the impact of this attribute on the final decision regarding a provider (E.
Michael Maximilien and Munindar P. Singh, 2005).
A logical data model is a model that is not specific to a database that describes things about
which an organization wants to collect data, and the relationships among these things (IBM,
2000). A logical model contains representations of entities and attributes, relationships,
unique identifiers, subtypes and super types, and constraints between relationships (IBM,
2000).
A logical model also contains domain model objects, or reference one or more domain or
glossary models. After logical objects and relationships are defined in a logical data model,
the workbench can be use to transform the logical model into a database-specific physical
representation in the form of a physical data model (IBM, 2000).
Logical database design has the aim of creating a data model that is completely independent
from any particular database management system (DBMS) or software/hardware platform. A
conceptual model is typically needed before the logical model is constructed. If the system is
8
large, it is often the case that individual logical models are constructed for each user view or
area within the business. Then, these separate models are merged into a global logical data
model.(Computing_Students,2005).
Figure 2.2.1: Logical data model of a simple library system (Computing Students, 2005)
Hire Purchase (HP) is the hiring of goods with the option to buy the goods at the end of the
hire purchase term. If you take on HP financing, you are the hirer and financier is the owner.
As a hirer, you will have to repay the financier based on the agreed duration while you have
possession of the vehicle. When all the installments are paid up, ownership is then transferred
to you.
The benefit of this system is that hirer gain immediate use of the asset without having to pay
a large amount for it or without having to borrow a large amount. Hire purchase should be
distinguished from installments sale wherein property passes to the purchaser with the
payment of the first installments (Ramanujam K.M., 1995).
HP transactions are governed by the Hire Purchase Act (Hire Purchase Act. 1967 (Reverse -
1978) [Reprint - 2001]). The HP Act sets out the forms and contents of HP agreements, the
legal rights, duties, obligations of hirers and financiers. The HP Act is administered by the
Ministry of Domestic Trade and Consumer Affairs.
To be valid, HP agreements must be in writing and signed by both parties. They must clearly
set out the following information in a print that all can read without effort:
10
7. The right of the hirer to terminate the contract when he feels like doing so with a valid
reason. (Wikipedia, 2009)
1. To buy the goods at any time by giving notice to the owner and paying the balance of
the HP price less a rebate (each jurisdiction has a different formula for calculating the
amount of this rebate)
2. To return the goods to the owner — this is subject to the payment of a penalty to
reflect the owner's loss of profit but subject to a maximum specified in each
jurisdiction's law to strike a balance between the need for the buyer to minimize
liability and the fact that the owner now has possession of an obsolescent asset of
reduced value
3. With the consent of the owner, to assign both the benefit and the burden of the
contract to a third person. The owner cannot unreasonably refuse consent where the
nominated third party has good credit rating
4. Where the owner wrongfully repossesses the goods, either to recover the goods plus
damages for loss of quiet possession or to damages representing the value of the
goods lost.
The owner usually has the right to terminate the agreement where the hirer defaults in paying
the installments or breaches any of the other terms in the agreement. This entitles the owner:
2. to retain the installments already paid and recover the balance due
11
The need to have a guarantor for HP financing would depend on the banking institution’s
credit assessment of your ability to repay the installments. If you default on your repayment,
the guarantor is liable for the unpaid portion of the HP financing and the interest due. A
person who agrees to be a guarantor will need to sign a letter of guarantee. He will also be
given a copy of the HP agreement within 14 days after the agreement is signed.
12
CHAPTER 3
3.0 METHODOLOGY
The methodology that used in this study is Rapid Application Development (RAD).
RAD restructures the process of building information systems and replaces hand-design and
coding processes. In addition to being more stable, Rapid Application Development is a more
capable process, as it is much faster and less error prone than hand coding. Traditional
development lifecycles are too slow and rigid to meet the business demands of today’s
economy. A new methodology must be implemented, one that allows organizations to build
software applications faster, better, and cheaper. RAD enables such development
(CASEMaker Inc. 1997-2000).
13
• To reduce the amount of time until the users begin to see a working system
• To use prototypes to their fullest potential (JS Consulting Group Inc., 2000-2009)
Figure 3.1.1: Rapid Application Development (RAD) Cycle (Officeware Corporation, 1996
- 1998)
• The focus is on delivering projects in small pieces. If you have a large project, you
need to look at ways to break it into smaller projects, each of which can be planned
and delivered individually. With a series of smaller projects, you can deliver each one
more quickly and in a less structured manner (Tom Mochal, 2001).
• Deliverables, including the final solution, are created using a repeating process of
analysis, design, construction, and testing. Prototypes are created early and evolved to
include more detail over time (Tom Mochal, 2001).
• RAD emphasizes reuse. This includes the reuse of code, processes, templates, and
tools. It is usually faster to assemble prebuilt components than to build everything
from scratch (Tom Mochal, 2001).
14
3.2. Analysis
• Plan the work plan first. A Work plan describes the activities needed to complete
the project
• Capture the business requirements and gather the requirements at a high level.
Focus on the main features and functions to be delivered, as well as the overall
batch and online processes
• The first time through the analysis phase, you should still look ahead in the project
to plan the approach for some of the later activities. Since the RAD project is
smaller, you can probably bypass the high-level strategy documents and focus
directly on the lower-level documents
• If the project is small enough, the plans can be bypassed as well, with the lower-
level activities discussed with the customer and placed directly into the Workplan
(Tom Mochal, 2001).
15
3.3. Designing
Figure 3.0 shows the traditional model for BMHPM. The HP card, payment
record, sale invoice record, customer information, hire purchase due date, staff information
and HP payment receipt records need to store in the book.
Book
Record
Sale Invoice Customer
Figure 3.0 Traditional Hire Purchase System for Boon Motor Enterprise (K) Sdn Bhd.
Presently, the hire purchase system has done all the work manually. All information is store
in a few record books. Therefore, the management will have to spend a lot of money to buy
books, stationery and hire many staff. This will increase the cost in management. Since all the
processes of recording data are doing manually, the possibility of data lost is high. It is
because some data may be lost because of ambiguous handwriting and failing. Sometimes,
data also keeping wrongly by the staffs. Records also can spill from the place or misplaced in
a different part of the file. The current system does not provide an efficient security because
anyone easy to access the company data without any permission. The lack of the security will
cause the company for losing their privacy. Besides that, the design of the books to store
information is simple; it can be easily changed by staff in the process of calculation of
amount installment and payment information.
16
Design
Figure 3.1 shows the conceptual model for BMHPM. The design of
conceptual model is based on the traditional hire purchase system shown at figure 3.0.
17
A Conceptual Model is a diagram of a set of relationships between certain factors that are
believed to impact or lead to a target condition.
In this conceptual model, first, user must login the system with authorized user id and
password, when login successful, system will display Hire Purchas Menu. If user needs to
insert new staff details, then he/she can add new staff information by Staff information form.
Besides that, user can add new invoice by Sale Invoice Form. Furthermore, user can add hirer
information, by Sale Invoice Form or Hirer Menu. In addition, user can also add vehicle
information by vehicle form or sale invoice form. User can view total loan, total monthly
loan, total yearly loan and total hirer loan by view form. After invoice created, user can view
hire purchase information and execute the HP document process such as print the HP
agreement, HP card, reminder, fourth schedule, repossession order and fifth schedule.
Moreover, user can also make purchase payment process, user can view the due date, overdue
interest amount, fully settlement amount, total collection, receipt and blacklist of hirer.
18
HpPaymentInfo
ReceiptNo
Manage AmountPay
PaymentType
1..* SaleNo
TotalOverdueInterest
Rebate
FullySettlement
Figure 3.2 Entity Relationship Diagram For Boon Motor Hire Purchase Management
System(BMHPM)
19
20
Logical model design has the aim of creating a data model that is completely independent
from any particular database management system (DBMS) or software/hardware platform. In
figure 3.2, the logical model contains 19 table, which are banker table, hppaytype table, jual
table, hpor table, hporno table, fon table, staff table, fee table, hpoverdue table, jualregno
table, jualhp table, personal table, customer table, negeri table, poskod table, alamat table,
vehsub table, termcharge table and vehicle table. This database had been normalizing.
Normalization is a process for evaluating and correcting table structures to minimize data
redundancies. Normalization help eliminate data anomalies. For example, address or
postcode of staff and customer are saving in same database which is alamat table. Besides
that, city or state of customer and staff also save in negeri table. The customer name is
separated in customer table and only 2 fields in the table; it is because when user needs to
search for customer information by customer name, system will retrieve data very fast.
21
22
Design a good interface is more effect when the user interacts with the Hire Purchase
system.
Login Menu
In this login menu, it has internal control. Each staffs have different username and password
that use to login to the system. The system can make sure that only the authorized person can
login to the system. The users who use the valid username and password, can login by press
enter for one time. But, if the users using wrong username or password more than three times,
the system will be automatically log out. Manager can access the entire menu in the system,
but general clerk can only access certain menu of this system. First, user needs to select
his/her name, after that he/she needs to insert the password, and then click the “Login”
button.
23
In this menu, user can check the hire purchase information of each vehicle by the vehicle
registration number. User can check amount installment, total installment pay, total month
paid, current balance, arrears of amount installment, total month due, total amount due, total
overdue interest, early settlement and total amount payable. Besides that, user can also search
the Hire Purchase information by using the hirer Name, hirer IcNo. Moreover, user is able to
print out the payment receipt, installment card, reminder, fourth schedule, RO or fifth
schedule.
24
User is able to search the Hire Purchase information by the vehicle registration number, hirer
.name, hirer IcNo
25
Hirer Menu
Hirer information of the company can be managed easily in the hirer menu. Users can add,
delete, and update the hirer details. Besides that, user is able to search the hirer information
by the hirer IC or hirer name.
26
Staff Menu
Personal details of the company’s staffs will be record in this menu. New staff’s details can
be record in a systematic way. There have some internal control in this menu, staff can only
update owns information only, and he /she are not able to delete or update other staff details.
However, all staffs’ information can be updated and deleted easily by manager. Only
manager can delete staff information.
27
Vehicle Menu
The vehicle information will be record in this menu. Users can add, delete, update and search
the data easily.
28
Users can create new invoice and record in the system. In addition, user is able to search
invoice by insert the vehicle registration number, hirer name, or hirer IC number.
Furthermore, user can also edit the invoice information such as invoice date, duration number
installment, chassis number, type of Hire Purchase. Furthermore, user is able to print out the
invoice, hire purchase agreement, second schedule, delivery report, authorized letter, keeping
vehicle registration card, hire purchase history card, consent of information summation for
hirer and guarantor.
29
View Menu
In this Hire Purchase view menu, user is able to view hirer information, sale invoice, Hire
Purchase daily, monthly and yearly loan, and Hire Purchase payment information. Besides
that, in the Hire Purchase view menu, user can also view Hire Purchase information by IC
number or vehicle registration number.
30
Details of hire purchase payment for each vehicle will be saving to the database. User can
make payment and official receipt will be issue to hirer from this menu.
31
Good design for database structure will make the system running smoothly and
quickly also to provide the data redundancy, it will reduce server overload.
Database
Alamat Table
The address of hirer, staff and bank will be saving into this table.
32
Banker table
Cek Table
Payment made by cheque will save into this table for record the cheque number and bank
code.Customer Table
33
This customer table is use for saving customer code and customer name.
Fee table
This table is use for saving sales number, road tax, registration fees, and no plate.
34
Fon table
This table is use for saving code, house phone, hand phone, office phone, and fax number.
Hpor Tablr
This table is use for saving receipt number, receipt date, amount paid, and sales number.
35
hporno Table
hpoverdue Table
This table is use for saving receipt number, receipt date, over due amount, and sales number.
36
Hppaytype Table
This table is use for saving customer receipt number, type of payment and cheque number.
Negeri table
37
Poskod table
Staff table
This table is use for saving staff id, staff name, salary and date of employ.
38
termcharge table
This table is use for saving interest, number installment, and rate of term charges.
Vehicle table
This table is use for saving chassis number, model, engine number, year make, cc, and color.
39
3.4. Prototyping
• At first, this may just be a series of screens that show how a business transaction is
processed. There may not be any database calls or business logic programmed
behind the screen shells.
• During this first pass, basic decisions also need to be made and tools to utilize, since
the prototype may lead directly to the solution.
• When you’ve completed the initial prototype, you can use it to gather additional,
more detailed business requirements from the customer.
• Once you get the modified set of requirements, you update the prototype to reflect
the new set of requirements. When that prototype is completed, you take it back to
the customer again to revalidate requirements.
• The project manager and customer need to agree on a fixed number of prototyping
iterations or else this cyclical process could go on forever.
• At that point, you will have two approaches to finish the project. First, if you
developed the prototypes with the final solution in mind, you need to finish the
design, programming, and testing of the solution using the prototype as the starting
point. In fact, depending on how much business logic you put into the last
prototype, you may find that your solution is close to being completed (Tom
Mochal, 2001).
• The other option is to throw away the prototype and begin developing the
production application from scratch. If you take this approach, it is imperative that
you don’t spend much effort on the prototype itself.
40
• In either case, the testing process still needs to be completed. The prototype may
have taken you through unit and integration testing, but you still need to system test
and gain user acceptance before the application can be implemented (Tom Mochal,
2001).
3.6. Implementation
• Normally, you do not prototype the implementation phase. So, the implementation
phase proceeds similarly to the waterfall method.
3.7 Summary
This project is an adoption of UML and prototyping process. The phases in the methodology
involved analysis and quick design, prototyping, testing and implementation.
In prototyping, a small system will be developed adopting the entire methodology, the
developed system will be tested to verify that the new version of the system does meet the
stated functionality specifications and requirements.
41
CHAPTER 4
4.0 SIGNIFICANCE/CONTRIBUTION
This study will uncover the hidden information within the Cooperation data. It is designed to
eliminate redundant data, reduce errors and improve the system by appending practical
function to manage the loan payment. It will attempt help the Cooperation to better manage
the loan payment and meets the users’ satisfaction.
42
CHAPTER 5
5.0 CONCLUSION
This chapter reviews the overall progress of the project. It included the contribution,
problems and limitation encountered during the development especially the security aspects
and enhancement of the total system.
• Although the prototype system is a client server-based system, it has not yet to be
tested in the real environment due to the time constraints.
43
5.3 Summary
The major contribution of this project is to give advantage to Boon Motor Enterprise (K)
Sdn Bhd and also their users. When the system is further enhanced into higher scale, it is not
a high cost development project and does not cost high maintenance. There are some
limitations such as time constraint and real environment testing discovered during the
development of the project. To overcome these limitation, suggestion like enhance the
security features and further development of the complete system which cover all section in
the company have been recommended for the further development of this project.
44
CHAPTER 6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Week
Task
System
requirement
Submit
proposal
Proposal
presentation
Design the
system
Implement the
system
Test the system
Draft of report
Final
Presentation
Submit final
report
45
REFERENCES
AAOIFI. 1998. Accounting and Auditing Standards for Islamic Financial Institutions.
Manama: Accounting and Auditing Organization for Islamic Financial Institutions.
Adnan, M. A. and Gaffikin, M 1997. The Shariah, Islamic banks and accounting concepts
and practices. Proceedings of International Conference 1: Accounting, Commerce and
Finance: The Islamic perspective, Sydney, Australia: University of Western Sydney
Agrawal N.K. & P.L. Joshi, “Accounting for Leases”, the Chartered Accountant Aug., 1983,
page 92-97.
Ahmad, S. N. S. and Hamat, M. 1992. Accounting standards and Islamic banks. Accacmadia
(Malaysia). 11 (1), 46-61.
Ahmed, Eltegani Abdelgader. 1994. Accounting postulates and principles from an Islamic
Perspective. Review of Islamic Economics, Vol. 3 No. 2, pp. 1-18. Beekun, Rafik
Isa.1997. Islamic Business Ethics. Herdon VA. IIIT.
Bohman P. (2004). Cognitive disabilities part 1: we still know too little and we do even less.
Retrieved Jun 23, 2009, from
http://www.webaim.org/techniques/articles/cognitive_too_little/.
46
Gary F. Simons (1994). Conceptual modeling versus visual modeling: a technological key to
building consensus. Retrieved 25 Jun 2009, from
http://www.sil.org/cellar/ach94/ach94.html
Giorgos Zacharia and Pattie Maes. Trust management through reputation mechanisms.
Applied Artificial Intelligence, 14:881–907, 2000.
McKinsey Corporation (1990), The Luxury Industry: An Asset for France, Paris: McKinsey.
Merton, Robert K. (1968), Social Theory and Social Structure, New York: Free Press.
MSP Resource Portal (2004). Multi Stakeholder Processes. Retrieved 25 Jun 2009, from
http://portals.wi.wur.nl/MSP/?Conceptual%20Modeling
Robert Delaney (2001). APA Citation Style. Retrieved from 25 Jun 2009, from
http://www.liu.edu/cwis/cwp/library/workshop/citapa.htm
Tom Mochal (2001). Examining the life cycle of a RAD project. Retrieved 25 Jun 2009, from
http://articles.techrepublic.com.com/5100-10878_11-5035295.html
U.S Food and Drug Administration (2009), M5 Data Elements and Standards for Drug
Dictionaries, Retrieved 25 Jun 2009, from http://www.hc-sc.gc.ca/dhp-
mps/prodpharma/applic-demande/guide-
ld/ich/consultation/m5_step2notice_etape2avis_fig1-eng.php
47
Vanguard University and Douglas Degelman (1994-2009). APA Style Essentials (1994-
2009). Retrieved 25 Jun 2009, from
http://www.vanguard.edu/faculty/ddegelman/index.aspx?doc_id=796
Computing Students, Notes > Database Systems > Logical and Conceptual Data Models,
Retrieved 24 Sept 2009, from
http://www.computingstudents.com/notes/database_systems/logical_conceptual_data_
models.php
IBM InfoSphere Data Architect, Version 7.5.1, Logical data models, Retrieved 24 Sept 2009,
from
http://publib.boulder.ibm.com/infocenter/idm/v2r2/index.jsp?topic=/com.ibm.datatools
.logical.ui.doc/topics/clogmod.html
http://www.hit.ac.il/staff/leonidM/information-systems/ch29.html
48
APPENDIX A
View Invoice Print Invoice Login << include >> View Printed
<< include >>
Collection Collection Reminder
View HP Print HP
Collection Collection View Printed Ro
<< include >> << include >>
Manage Company
Information
View Staff Information
Manage Staff
View Hirer Information Information
Create Invoice
49
View Printed RO
View Invoice Print Invoice Collection
Collection
Manager
View Staff Information
Manage Company
Information
Print Fifth View RO Print Fourth View Reminder Print Invoice View HP View Invoice
Make Hp
Schedule Schedule Payment payment payment
<< include >>
<< include >>
<< include >>
View Hp Schedule
Create Invoice
50
Sequence Diagram
E1 : Invalid ID
and Password
E1 : Invalid ID
and Password
51
Delete Data ( )
Clear text ( )
52
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
E2 : Data
Not Found
Verify Data ( )
Delete Data ( )
Clear text ( )
53
Insert Data ( )
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
E2 : Data
Not Found
Verify Data ( )
Delete Data ( )
Clear text ( )
54
Insert Data ( )
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
E2 : Data
Not Found
Verify Data ( )
Delete Data ( )
Clear text ( )
55
Insert Data ( )
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
Insert Chassis No ( )
E2 : Data
Not Found
Verify Data ( )
Delete Data ( )
Clear text ( )
56
Insert Data ( )
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
Insert Chassis No ( )
E2 : Data
Not Found
Verify Data ( )
Delete Data ( )
Clear text ( )
57
Insert Data ( )
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
E2 : Data
Not Found
Verify Data ( )
Delete Data ( )
Clear text ( )
58
Insert Data ( )
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
E2 : Data
Not Found
Verify Data ( )
Delete Data ( )
Clear text ( )
59
Edit Data ( )
Clear text ( )
60
Edit Data ( )
Clear text ( )
61
Invoice Info Panel : Invoice Payment Panel : Invoice Info Manager : Invois Payment Manager: Invois : InvoisBayar : Printer :
Invoice Info Panel Invoice Payment Panel Invoice Info Manager Invois Payment Manager Invois InvoisBayar Printer
: Administrator
Insert Data ( )
Verify Data ( )
Clear Text ( )
Insert Invoice No ( )
Verify Data ( )
Print Invoice ( )
62
Insert Data ( )
Verify Data ( )
Clear Text ( )
Insert Invoice No ( )
Verify Data ( )
Print Invoice ( )
63
HP Info Panel : HP Payment Panel : Hp Info Manager: HP Payment Manager : HPinfo : HPbayar : Printer :
HP Info Panel HP Payment Panel Hp Info Manager HP Payment Manager HPinfo HPbayar Printer
: Administrator
Press "Enter"
Check Vehicle Number ( )
Retrieve Data ( )
Display Data ( )
Verify Data ( )
A1 : View A2 View HP
HP Schedule Payment Record
HP Info Panel : HP Payment Panel : Hp Info Manager: HP Payment Manager : HPinfo : HPbayar : Printer :
HP Info Panel HP Payment Panel Hp Info Manager HP Payment Manager HPinfo HPbayar Printer
:Manager
Press "Enter"
Check Vehicle Number ( )
Retrieve Data ( )
Display Data ( )
Verify Data ( )
A1 : View A2 View HP
HP Schedule Payment Record
64
Select Date ( )
Send Request ( )
Select Data ( )
Print Reminder
Select Date ( )
Send Request ( )
Select Data ( )
Print Reminder
65
Select Date ( )
Send Request ( )
Select Data ( )
Check Data ( )
Save Data ( )
Fourth Schedule Panel : Fourth Schedule Manager : Post Information Panel : Post Information Manager : Suratkirim : Printer :
Fourth Schedule Panel : Fourth Schedule Manager Post Information Panel Post Information Manager Suratkirim : Printer
:Manager
Select Date ( )
Send Request ( )
Select Data ( )
Check Data ( )
Save Data ( )
66
Select Date ( )
Send Request ( )
Select Data ( )
Print RO ( )
Select Date ( )
Send Request ( )
Select Data ( )
Print RO ( )
67
Fifth Schedule Panel: Fifth Schedule Manager: Post Information Panel : Post Information Manager : Suratkirim : Printer :
Fifth Schedule Panel Fifth Schedule Manager Post Information Panel Post Information Manager Suratkirim : Printer
: Administrator
Select Date ( )
Send Request ( )
Select Data ( )
Check Data ( )
Save Data ( )
Fifth Schedule Panel: Fifth Schedule Manager: Post Information Panel : Post Information Manager : Suratkirim : Printer :
Fifth Schedule Panel Fifth Schedule Manager Post Information Panel Post Information Manager Suratkirim : Printer
: Manager
Select Date ( )
Send Request ( )
Select Data ( )
Check Data ( )
Save Data ( )
68
Verify Data ( )
Display Data ( )
Verify Data ( )
Display Data ( )
69
Verify Data ( )
Display Data ( )
Verify Data ( )
Display Data ( )
70
Verify Data ( )
Display Data ( )
Verify Data ( )
Display Data ( )
71
Verify Data ( )
Display Data ( )
Verify Data ( )
Display Data ( )
72
Send Request ( )
Retrieve Data ( )
Verify Data ( )
Display Data ( )
Send Request ( )
Retrieve Data ( )
Verify Data ( )
Display Data ( )
73
Verify Data ( )
Display Data ( )
Verify Data ( )
Display Data ( )
74
Verify Data ( )
Display Data ( )
Verify Data ( )
Display Data ( )
75
Sequence Diagram for View Late HP Payment Information Use Case (Administrator)
Verify Data ( )
Display Data ( )
Sequence Diagram for View Late HP payment Information Use Case (Manager)
Verify Data ( )
Display Data ( )
76
Send Request ( )
Retrieve Data ( )
Verify Data ( )
Display Data ( )
Send Request ( )
Retrieve Data ( )
Verify Data ( )
Display Data ( )
77
Send Request ( )
Retrieve Data ( )
Verify Data ( )
Display Data ( )
Send Request ( )
Retrieve Data ( )
Verify Data ( )
Display Data ( )
78
Verify Data ( )
Display Data ( )
Double Click the record in FlexGrid ( )
Send Request ( ) Retrieve Data ( )
Display Report ( )
Verify Data ( )
Display Data ( )
Double Click the record in FlexGrid ( )
Send Request ( ) Retrieve Data ( )
Display Report ( )
79
Verify Data ( )
Display Data ( )
Double Click the record in FlexGrid ( )
Send Request ( ) Retrieve Data ( )
Display Report ( )
Verify Data ( )
Display Data ( )
Double Click the record in FlexGrid ( )
Send Request ( ) Retrieve Data ( )
Display Report ( )
80
Verify Data ( )
Display Data ( )
Double Click the record in FlexGrid ( )
Send Request ( ) Retrieve Data ( )
Display Report ( )
Verify Data ( )
Display Data ( )
Double Click the record in FlexGrid ( )
Send Request ( ) Retrieve Data ( )
Display Report ( )
81
Press Enter ( )
Check Data ( )
Retrieve Data ( )
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
Press "Delete" Button ( )
Send Request ( )
Delete Data ( )
82
Invoice Info Panel: Invoice Info Manager: Payment Info Panel: Payment Manager: Invoisbayar:
Invoice Info Panel Invoice Info Manager Payment Info Panel Payment Manager Invoisbayar
: Manager
Press Enter ( )
Check Data ( )
Retrieve Data ( )
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
83
Press Enter ( )
Check Data ( )
Retrieve Data ( )
E1 : Data
Not Found
Verify Data ( )
Display Data ( )
Select Payment Date ( )
Send Request ( )
84
CODDING
Login Menu
Private mNode As Node
Private ChildNode As Node
Dim cuba As Integer
Function pangkalan()
Data1.DatabaseName = App.Path + "\db1.mdb"
Data2.DatabaseName = App.Path + "\db1.mdb"
gabung
End Function
Function gabung()
Data1.RecordSource = "select * from pword"
Data2.RecordSource = "select * from staff order by staffname"
Data1.Refresh
Data2.Refresh
End Function
Function AddNodes()
With TreeView1.Nodes
.Clear
Data2.Refresh
x = 1
Dim nodX As Node
Do Until Data2.Recordset.EOF
Set nodX = TreeView1.Nodes.Add(, , , Data2.Recordset![staffname], 1, 2)
Data2.Recordset.MoveNext
Loop
End With
End Function
Function batal()
Text1 = ""
Text2 = ""
End Function
Function masuk()
If Text1 = "" Then
MsgBox "Login Not allow,Please enter Staff ID and Password", vbCritical, "Login System"
Text1.SetFocus
Else
cuba = cuba + 1
If cuba < 3 Then
cariid = "code='" & Text1 & "'and password='" & Text2 & "'"
Data1.Refresh
With Data1.Recordset 'login table
.FindFirst cariid
If .NoMatch Then
MsgBox "Invalid Staff ID and Password,Please try again!", vbCritical, "Error Login System"
batal
Text1.SetFocus
85
Else
hpinfofrm.Show
End If
End With
Else
End
End If
End If
End Function
Private Sub Command1_Click()
masuk
End Sub
Private Sub Command2_Click()
batal
Text1.SetFocus
End Sub
Private Sub Command4_Click()
If MsgBox("Are sure want to Logout system,Please Press [YES] for Logout", vbDefaultButton2 + vbExclamation
+ vbYesNo, "Exit System") = vbYes Then
End
Else
Exit Sub
End If
End Sub
Private Sub Form_Load()
batal
Label12 = Format(Date, "ddddd")
Label6 = Format(Time, "hh:mm:ss")
pangkalan
AddNodes
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then masuk: SendKeys vbTab
End Sub
Private Sub Timer1_Timer()
Label6 = Format(Time, "hh:mm:ss")
End Sub
86
Hirer Information
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Function pangkalan()
Data1.DatabaseName = App.Path + "\db1.mdb"
Data2.DatabaseName = App.Path + "\db1.mdb"
Data3.DatabaseName = App.Path + "\db1.mdb"
Data4.DatabaseName = App.Path + "\db1.mdb"
Data5.DatabaseName = App.Path + "\db1.mdb"
Data6.DatabaseName = App.Path + "\db1.mdb"
Data7.DatabaseName = App.Path + "\db1.mdb"
gabung
End Function
Function gabung()
Data1.RecordSource = "select * from customer order by customername"
Data2.RecordSource = "select * from personal"
Data3.RecordSource = "select * from alamat order by code"
Data4.RecordSource = "select * from poskod order by postcode"
Data5.RecordSource = "select * from negeri order by state"
Data6.RecordSource = "select * from fon"
Data1.Refresh
Data2.Refresh
Data3.Refresh
Data4.Refresh
Data5.Refresh
Data6.Refresh
End Function
Function simpancustomer() 'customer table
If Text1 = "" Then
Text1.SetFocus
Else
carikod = "customercode='" & Text1 & "'"
With Data1.Recordset
.FindFirst carikod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![customercode] = Text1
![customername] = Format(Text2, ">")
.Update
Data1.Refresh
simpanpersonal
simpanalamat
simpanfon
bar
batal
kombokerja
kombobandar
kombonegeri
Text1.SetFocus
87
End With
End If
End Function
Function simpanpersonal() 'table subinfo
carikod = "code='" & Text1 & "'"
With Data2.Recordset
.FindFirst carikod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![code] = Text1
If IsDate(Text5) Then
![Birthdate] = Format(Text5, "ddddd")
End If
![newic] = Text10
![oldic] = Text11
![Gender] = Text12
![occupation] = Text13
![statu] = Text16
.Update
End With
Data2.Refresh
End Function
Function simpanalamat() 'table alamat
carikod = "code='" & Text1 & "'"
With Data3.Recordset
.FindFirst carikod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![code] = Text1
![Address] = Text3
![postcode] = Text4
.Update
Data3.Refresh
simpanposkod
End With
End Function
Function simpanposkod() 'table poskod
caripkod = "postcode='" & Text4 & "'"
With Data4.Recordset
.FindFirst caripkod
If .NoMatch Then
.AddNew
Else
.Edit
End If
88
![postcode] = Text4
![City] = Text15
Data4.Refresh
simpannegeri
.Update
End With
End Function
Function simpannegeri() 'table negeri
carict = "city='" & Text15 & "'"
With Data5.Recordset
.FindFirst carict
If .NoMatch Then
.AddNew
Else
.Edit
End If
![City] = Text15
![State] = Text16
.Update
End With
Data5.Refresh
End Function
Function simpanfon() 'table fon
carikod = "code='" & Text1 & "'"
With Data6.Recordset
.FindFirst carikod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![code] = Text1
![housephone] = Format(Text6, ">")
![handphone] = Format(Text7, ">")
![officephone] = Format(Text8, ">")
![fax] = Format(Text9, ">")
.Update
Data6.Refresh
End With
End Function
Function lihatcustomer() 'customer table
If Text1 = "" Then
Text1.SetFocus
Else
Data1.Refresh
carikod = "customercode='" & Text1 & "'"
With Data1.Recordset
.FindFirst carikod
If .NoMatch Then
Text10.SetFocus
Else
89
Text1 = ![customercode]
Text2 = Format(![customername], ">")
lihatpersonal
lihatalamat
lihatfon
End If
End With
End If
End Function
Function lihatpersonal() 'table personal
Data2.Refresh
carikod = "code='" & Text1 & "'"
With Data2.Recordset
.FindFirst carikod
If .NoMatch Then
Else
Text1 = Format(![code], ">")
Text5 = Format(![Birthdate], "ddddd")
Text10 = Format(![newic], ">")
Text11 = Format(![oldic], ">")
Text12 = ![Gender]
Text13 = Format(![occupation], ">")
Text14 = ![statu]
End If
End With
Data2.Refresh
End Function
Function lihatalamat() 'table alamat
Data3.Refresh
carikod = "code='" & Text1 & "'"
With Data3.Recordset
.FindFirst carikod
If .NoMatch Then
Else
Text1 = ![code]
Text3 = ![Address]
Text4 = ![postcode]
lihatposkod
End If
End With
End Function
Function lihatposkod() 'table poskod
caripkod = "postcode='" & Text4 & "'"
Data4.Refresh
With Data4.Recordset
.FindFirst caripkod
If .NoMatch Then
Else
Text4 = ![postcode]
Text15 = ![City]
lihatnegeri
90
End If
End With
End Function
Function lihatnegeri() 'table negeri
Data5.Refresh
carict = "city='" & Text15 & "'"
With Data5.Recordset
.FindFirst carict
If .NoMatch Then
Else
Text15 = ![City]
Text16 = ![State]
End If
End With
End Function
Function lihatfon() 'table fon
Data6.Refresh
carikod = "code='" & Text1 & "'"
With Data6.Recordset
.FindFirst carikod
If .NoMatch Then
Else
Text1 = ![code]
Text6 = Format(![housephone], ">")
Text7 = Format(![handphone], ">")
Text8 = Format(![officephone], ">")
Text9 = Format(![fax], ">")
End If
End With
End Function
Function lihatnewic() 'table personal
Data2.Refresh
carinic = "newic='" & Text10 & "'"
With Data2.Recordset
.FindFirst carinic
If .NoMatch Then
Else
Text1 = Format(![code], ">")
Text5 = Format(![Birthdate], "ddddd")
Text10 = Format(![newic], ">")
Text11 = Format(![oldic], ">")
Text12 = ![Gender]
Text13 = Format(![occupation], ">")
Text14 = ![statu]
carikod = "customercode='" & Text1 & "'"
Data1.Refresh
With Data1.Recordset
.FindFirst carikod
If .NoMatch Then
Else
Text1 = ![customercode]
91
Text2 = ![customername]
lihatalamat
lihatfon
End If
End With
End If
End With
End Function
Function kp()
n = Mid(Text10, 12)
If n = "" Then
Else
nokp = Left(Text10, 6)
tahun = Left(nokp, 2)
bln = Left(nokp, 4)
bulan = Right(bln, 2)
hari = Right(nokp, 2)
Text5 = Format(Str(hari) + "/" + Str(bulan) + "/" + Str(tahun), "ddddd")
If Right(Text10, 1) Mod 2 = 0 Then
Text12 = "FEMALE"
Else
Text12 = "MALE"
End If
End If
End Function
Function lihatoldic() 'table personal
Data2.Refresh
carioic = "oldic='" & Text11 & "'"
With Data2.Recordset
.FindFirst carioic
If .NoMatch Then
Text13.SetFocus
Else
If ![oldic] = "" Then
Else
Text1 = ![code]
Text5 = Format(![Birthdate], "ddddd")
Text10 = ![newic]
Text12 = ![Gender]
Text13 = Format(![occupation], ">")
Text14 = ![statu]
carinic = "customercode='" & Text1 & "'"
Data1.Refresh
With Data1.Recordset
.FindFirst carinic
If .NoMatch Then
Else
Text1 = ![customercode]
Text2 = ![customername]
End If
End With
lihatalamat
92
lihatfon
End If
End If
End With
End Function
Function lihatgrid()
Data7.RecordSource = "select CustomerCode,CustomerName,NewIc " & _
"from customer,personal " & _
"where customer.customercode=personal.code " & _
"and customername like '" & Text2 & "*'order by customername"
Data7.Refresh
End Function
Function hapus()
If Text1 = "" Then
MsgBox "Delete not allow! Please enter Customer Code", vbCritical, "DELETE CUSTOMER INFORMATION"
Text1.SetFocus
Else
cari = "customercode='" & Text1 & "'"
Data1.Refresh
With Data1.Recordset
.FindFirst cari
If .NoMatch Then
Text1 = ""
Text1.SetFocus
Else
del = "Please Press [YES] for DELETE Customer Record"
If MsgBox(del, vbDefaultButton2 + vbYesNo, "DELETE CUSTOMER RECORD") = vbYes Then
.Delete
cariic = "code='" & Text1 & "'"
Data2.Refresh
With Data2.Recordset 'personal
.FindFirst cariic
If .NoMatch Then
Else
.Delete
Data2.Refresh
End If
End With
Data6.Refresh
With Data6.Recordset 'fon
.FindFirst cariic
If .NoMatch Then
Else
.Delete
Data6.Refresh
End If
End With
batal
Text1.SetFocus
Else
batal
Text1.SetFocus
93
End If
End If
End With
Data1.Refresh
End If
End Function
Function kombobandar()
Combo1.Clear
Data7.RecordSource = "select * from negeri order by city"
Data7.Refresh
With Data7.Recordset
Do Until .EOF
Combo1.AddItem ![City]
.MoveNext
Loop
End With
End Function
Function kombonegeri()
Combo2.Clear
Data7.RecordSource = "select distinct state from negeri order by state"
Data7.Refresh
With Data7.Recordset
Do Until .EOF
Combo2.AddItem ![State]
.MoveNext
Loop
End With
Data7.RecordSource = "negeri"
Data7.Refresh
End Function
Function kombokerja()
Combo4.Clear
Data7.RecordSource = "select distinct occupation from personal order by occupation"
Data7.Refresh
With Data7.Recordset
Do Until .EOF
Combo4.AddItem Format(![occupation], ">")
.MoveNext
Loop
End With
Data7.RecordSource = "personal"
Data7.Refresh
End Function
Function batal()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
End Function
94
Private Sub cmdCancel_Click()
batal
Text1.SetFocus
End Sub
Private Sub cmdDelete_Click()
hapus
Text1.SetFocus
End Sub
Private Sub cmdSave1_Click()
simpancustomer
Text1.SetFocus
End Sub
Private Sub cmdSearch_Click()
lihatgrid
End Sub
Private Sub Command1_Click()
lihatnewic
End Sub
Private Sub Command5_Click()
lihatgrid
End Sub
Private Sub Command7_Click()
Unload Me
End Sub
Private Sub DTPicker1_CloseUp()
Text5 = Format(DTPicker1, "dd/mm/yyyy")
Text11.SetFocus
End Sub
Private Sub Form_Load()
batal
DTPicker1 = Format(Date, "dd/mm/yyyy")
pangkalan
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatcustomer
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
95
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatposkod: SendKeys vbTab
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatnegeri: SendKeys vbTab
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
96
Hire Purchase Main Information
Function pangkalan()
Data1.DatabaseName = App.Path + "\db1.mdb"
Data2.DatabaseName = App.Path + "\db1.mdb"
Data3.DatabaseName = App.Path + "\db1.mdb"
Data4.DatabaseName = App.Path + "\db1.mdb"
Data5.DatabaseName = App.Path + "\db1.mdb"
Data6.DatabaseName = App.Path + "\db1.mdb"
Data7.DatabaseName = App.Path + "\db1.mdb"
Data8.DatabaseName = App.Path + "\db1.mdb"
Data9.DatabaseName = App.Path + "\db1.mdb" 'sql
gabung
End Function
Function gabung()
Data1.RecordSource = "select * from jualregno"
Data2.RecordSource = "select * from jual"
Data3.RecordSource = "select * from jualhp"
Data4.RecordSource = "select * from vehicle"
Data5.RecordSource = "select * from vehsub"
Data6.RecordSource = "select * from personal"
Data7.RecordSource = "select * from hpor"
Data8.RecordSource = "select * from customer"
Data1.Refresh
Data2.Refresh
Data3.Refresh
Data4.Refresh
Data5.Refresh
Data6.Refresh
Data7.Refresh
Data8.Refresh
End Function
Function lihatvehicle()
If Text1 = "" Then
MsgBox "Please enter Vehicle No", vbCritical, "Search Hire Purchase Information"
Text1.SetFocus
Else
lihathp
Text2.SetFocus
End If
End Function
Function carijualhp()
carisno = "saleno=" & Label19 & ""
Data3.Refresh
With Data3.Recordset 'jualhp table
.FindFirst carisno
If .NoMatch Then
Else
Label26 = 0
kadar = ![interestrate]
Label27 = Format(![hptype], ">")
97
Label22 = Format(![payment], "fixed") 'down payment
Label26 = ![hpmonth] 'no instalment or duration
Label23 = Format(Label21 ‐ Label22, "fixed") 'amount loan
Label24 = Format(Label23 * kadar / 100 * Label26 / 12, "fixed") 'interest amount for monthly
Label25 = Format(Val(Label23) + Val(Label24), "fixed") 'total amount payable
Label29 = Format(Val(Label25) / Val(Label26), "####0.00") 'amount instalment
End If
End With
End Function
Function lihatpelanggan()
carickod = "customercode='" & Text2 & "'"
Data8.Refresh
With Data8.Recordset 'customer table
.FindFirst carickod
If .NoMatch Then
Else
Text3 = ![customername]
carikod = "code='" & Text2 & "'"
Data6.Refresh
With Data6.Recordset
.FindFirst carikod
If .NoMatch Then
Else
Label49 = ![oldic]
End If
End With
End If
End With
End Function
Function kiradownpayment()
jumjualresit = 0
Data9.RecordSource = "select * from jualresit"
Data9.Refresh
With Data9.Recordset 'jualresit table
Do Until .EOF
If ![saleno] = Label19 Then
jumjualresit = jumjualresit + Val(![amountpay])
End If
.MoveNext
Loop
End With
Label51 = Format(Label22 ‐ jumjualresit, "fixed") 'checking down payment overdue
End Function
Function kirasudahbayar()
jumbayar = 0
Data7.Refresh
With Data7.Recordset
Do Until .EOF
If ![saleno] = Label19 Then
jumbayar = jumbayar + Val(![amount])
End If
98
.MoveNext
Loop
End With
Label40 = Format(jumbayar, "####0.00")
If Label40 = "0.00" Then
Label30 = 0
Else
bulansudahbayar = 0
bulansudahbayar = Label40 / Label29 'check number instalment pay
Dim x, titik As Integer
titik = 1
x = 0
For x = 1 To Len(bulansudahbayar) ' untuk mencari kedudukan titik perpuluhan
If Mid(bulansudahbayar, x, 1) = "." Then
titik = x
Exit For
End If
Next
jawapan = Mid(bulansudahbayar, 1, titik ‐ 1) 'bulanan tanpa titik
If jawapan = "" Then
Label30 = bulansudahbayar
Else
Label30 = jawapan
End If
End If
jumkenabayar = 0
jumkenabayar = Format(bulandue * Label29 ‐ Label40, "fixed")
bulanhutang = bulandue ‐ Val(Label30)
If bulanhutang <= 0 Then
Label45 = 0
Else
Label45 = bulanhutang 'bulandue ‐ label30
End If
If jumkenabayar <= 0 Then
Label33 = "0.00"
Else
Label33 = Format(jumkenabayar, "fixed")
End If
End Function
Function kirajumlahlewat()
jumodue = 0
Data9.RecordSource = "select * from hpoverdue"
Data9.Refresh
With Data9.Recordset 'hpoverdue table
Do Until .EOF
If ![saleno] = Label19 Then
jumodue = jumodue + Val(![overdue])
End If
.MoveNext
Loop
End With
If jumodue <= 0 Then
Label35 = "0.00"
99
Else
Label35 = Format(jumodue, "fixed")
End If
End Function
Function kirajumlahhutang()
Label31 = Format(Label25 ‐ Label40, "fixed") 'current balance
bakihutang = Val(Label31) + Val(Label35) 'total balance include overdue
If bakihutang <= 0 Then
Label44 = "0.00"
Else
Label44 = Format(bakihutang, "fixed")
End If
If Val(Label40) = 0 Then
bulandue = DateDiff("m", Label41, Date) + 1 'kira bulan hutang untuk bulanan jika m=0 kena +1
Else
bulandue = DateDiff("m", Label41, Date)
End If
End If
If bulandue > Val(Label26) Then 'cari jika bulandue besar daripada no instalment
bulandue = Label26 'jika bulandue besar jadi bulandue mesti =label26(no instalment)
End If
jumkenabayar = 0
jumkenabayar = Format(bulandue * Label29 ‐ Label40, "fixed") 'kira jumlah hutang selapas tolak bulanan
telah bayar
bulanhutang = bulandue ‐ Val(Label30) 'kira berapa bulan telah lewat
If bulanhutang <= 0 Then
Label45 = 0 'jika bulan tidak lewat
Else
Label45 = bulanhutang 'bulan telah lewat
End If
If jumkenabayar <= 0 Then
Label33 = "0.00"
Else
Label33 = Format(jumkenabayar, "fixed")
End If
End Function
Function lihathp()
carisno = "saleno=" & Label19 & ""
Data2.Refresh
With Data2.Recordset 'jual table
.FindFirst carisno
If .NoMatch Then
MsgBox "No such Vehicle No,Please try again", vbExclamation, "Search HP Information"
Text1.SetFocus
Else
Label20 = Format(![saledate], "ddddd")
Label21 = Format(![saleprice], "fixed")
Text2 = ![customercode]
casisno = ![chassisno]
caricno = "chassisno='" & casisno & "'"
Data4.Refresh
With Data4.Recordset 'vehicle table
100
.FindFirst caricno
If .NoMatch Then
Else
End If
End With
lihatpelanggan
carijualhp
lihatmula
kirasudahbayar
kirajumlahlewat
kirajumlahhutang
lihatdue
End If
End With
End Function
Function lihatmula()
hari = Day(Label20)
bulan = Month(Label20)
tahun = Year(Label20)
If Label27 = "MUSIM" Then 'cari tarikh mula untuk bayaran musim
bulan = bulan + 6
If bulan > 12 Then
bulan = bulan ‐ 12
tahun = tahun + 1
End If
Else
bulan = bulan + 1 'cari tarikh mula untuk bayaran bulanan
If bulan > 12 Then
tahun = tahun + 1
bulan = 1
End If
End If
If bulan = 2 Or bulan = 4 Or bulan = 6 Or bulan = 9 Or bulan = 11 Then
If hari > 30 Then
hari = 30
End If
Else
If hari > 30 Then
hari = 31
End If
End If
If bulan = 2 Then
If tahun Mod 4 = 0 Then
If hari > 29 Then
hari = 29
End If
Else
If hari > 28 Then
hari = 28
End If
End If
End If
Label41 = Format(Str(hari) + "/" + Str(bulan) + "/" + Str(tahun), "ddddd") 'commencing date
101
End Function
Function batal()
Text1 = ""
Text2 = ""
Text3 = ""
Label19 = ""
Label20 = ""
Label21 = ""
Label22 = ""
Label23 = ""
Label24 = ""
Label25 = ""
Label26 = ""
Label27 = ""
Label28 = ""
Label29 = ""
Label30 = "0"
Label31 = ""
Label32 = ""
Label33 = "0"
Label35 = "0"
Label40 = "0"
Label41 = ""
Label44 = "0"
Label45 = "0"
Label49 = ""
Label51 = ""
End Function
Private Sub cmdCancel_Click()
batal
m1.Visible = False
m2.Visible = False
Text1.SetFocus
End Sub
Private Sub cmdSearch_Click()
If Text2 = "" And Text3 = "" And Text1 <> "" Then
Data9.RecordSource = "select jualhp.SaleNo,VehicleNo,SaleDate,CustomerName " & _
"from jualhp,jualregno,jual,customer " & _
"where jualhp.saleno=jualregno.saleno " & _
"and jualhp.saleno=jual.saleno " & _
"and saletype='" & "HP" & "' " & _
"and jual.customercode=customer.customercode " & _
"and vehicleno='" & Text1 & "'order by jual.saleno"
ElseIf Text1 = "" And Text3 = "" And Text2 <> "" Then
Data9.RecordSource = "select jualhp.SaleNo,VehicleNo,SaleDate,CustomerName " & _
"from jualhp,jualregno,jual,customer " & _
"where jualhp.saleno=jualregno.saleno " & _
"and jualhp.saleno=jual.saleno " & _
"and saletype='" & "HP" & "' " & _
"and jual.customercode=customer.customercode " & _
"and customer.customercode='" & Text2 & "'order by vehicleno"
102
ElseIf Text1 = "" And Text2 = "" And Text3 <> "" Then
Data9.RecordSource = "select jualhp.SaleNo,VehicleNo,SaleDate,CustomerName " & _
"from jualhp,jualregno,jual,customer " & _
"where jualhp.saleno=jualregno.saleno " & _
"and jualhp.saleno=jual.saleno " & _
"and saletype='" & "HP" & "' " & _
"and jual.customercode=customer.customercode " & _
"and customer.customername like'" & Text3 & "*'order by vehicleno"
Else
Data9.RecordSource = "select jualhp.SaleNo,VehicleNo,SaleDate,CustomerName " & _
"from jualhp,jualregno,jual,customer " & _
"where jualhp.saleno=jualregno.saleno " & _
"and jualhp.saleno=jual.saleno " & _
"and saletype='" & "HP" & "' " & _
"and jual.customercode=customer.customercode order by vehicleno"
End If
Data9.Refresh
bil = Data9.Recordset.RecordCount
For i = 1 To bil
m1.TextMatrix(i, 0) = i
Next
kotak
End Sub
Private Sub Command1_Click()
If Text1 = "" Then
MsgBox "Process not allow,Please enter Vehicle No", vbCritical, "HP Payment"
Text1.SetFocus
Else
hporfrm.Show
End If
End Sub
Private Sub Command2_Click()
hirerfrm.Show
End Sub
Private Sub Command3_Click()
stafffrm.Show
End Sub
Private Sub Command4_Click()
vehiclefrm.Show
End Sub
Private Sub Command5_Click()
insuranfrm.Show
End Sub
Private Sub Command6_Click()
jualfrm.Show
End Sub
103
Private Sub Command7_Click()
Unload Me
End Sub
Private Sub Command8_Click()
viewhpfrm.Show
End Sub
Private Sub Form_Load()
batal
pangkalan
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatvehicle
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
104
Hire Purchase Payment
Function pangkalan()
Data1.DatabaseName = App.Path + "\db1.mdb"
Data2.DatabaseName = App.Path + "\db1.mdb"
Data3.DatabaseName = App.Path + "\db1.mdb"
Data4.DatabaseName = App.Path + "\db1.mdb"
Data5.DatabaseName = App.Path + "\db1.mdb"
Data6.DatabaseName = App.Path + "\db1.mdb"
gabung
End Function
Function gabung()
Data1.RecordSource = "select * from jualregno"
Data2.RecordSource = "select * from jual"
Data3.RecordSource = "select * from jualhp"
Data4.RecordSource = "select * from vehicle"
Data5.RecordSource = "select * from vehsub"
Data6.RecordSource = "select * from personal"
Data1.Refresh
Data2.Refresh
Data3.Refresh
Data4.Refresh
Data5.Refresh
Data6.Refresh
End Function
Function carijualhp()
carisno = "saleno=" & Label19 & ""
Data3.Refresh
With Data3.Recordset 'jualhp table
.FindFirst carisno
If .NoMatch Then
Else
Label26 = 0
kadar = ![interestrate]
Label27 = Format(![hptype], ">")
Label22 = Format(![payment], "fixed") 'down payment
Label26 = ![hpmonth] 'no instalment or duration
Label23 = Format(Label21 ‐ Label22, "fixed") 'amount loan
Label24 = Format(Label23 * kadar / 100 * Label26 / 12, "fixed") 'interest amount for monthly
Label25 = Format(Val(Label23) + Val(Label24), "fixed") 'total amount payable
Label29 = Format(Val(Label25) / Val(Label26), "####0.00") 'amount instalment
End If
End With
End Function
Function lihatpelanggan()
carickod = "customercode='" & Text2 & "'"
Data8.Refresh
With Data8.Recordset 'customer table
.FindFirst carickod
If .NoMatch Then
Else
105
Text3 = ![customername]
carikod = "code='" & Text2 & "'"
Data6.Refresh
With Data6.Recordset
.FindFirst carikod
If .NoMatch Then
Else
Label49 = ![oldic]
End If
End With
End If
End With
End Function
Function kiradownpayment()
jumjualresit = 0
Data9.RecordSource = "select * from jualresit"
Data9.Refresh
With Data9.Recordset 'jualresit table
Do Until .EOF
If ![saleno] = Label19 Then
jumjualresit = jumjualresit + Val(![amountpay])
End If
.MoveNext
Loop
End With
Label51 = Format(Label22 ‐ jumjualresit, "fixed") 'checking down payment overdue
End Function
Function kirasudahbayar()
jumbayar = 0
Data7.Refresh
With Data7.Recordset
Do Until .EOF
If ![saleno] = Label19 Then
jumbayar = jumbayar + Val(![amount])
End If
.MoveNext
Loop
End With
Label40 = Format(jumbayar, "####0.00")
If Label40 = "0.00" Then
Label30 = 0
Else
bulansudahbayar = 0
bulansudahbayar = Label40 / Label29 'check number instalment pay
Dim x, titik As Integer
titik = 1
x = 0
For x = 1 To Len(bulansudahbayar) ' untuk mencari kedudukan titik perpuluhan
If Mid(bulansudahbayar, x, 1) = "." Then
titik = x
Exit For
End If
106
Next
jawapan = Mid(bulansudahbayar, 1, titik ‐ 1) 'bulanan tanpa titik
If jawapan = "" Then
Label30 = bulansudahbayar
Else
Label30 = jawapan
End If
End If
jumkenabayar = 0
jumkenabayar = Format(bulandue * Label29 ‐ Label40, "fixed")
bulanhutang = bulandue ‐ Val(Label30)
If bulanhutang <= 0 Then
Label45 = 0
Else
Label45 = bulanhutang 'bulandue ‐ label30
End If
If jumkenabayar <= 0 Then
Label33 = "0.00"
Else
Label33 = Format(jumkenabayar, "fixed")
End If
End Function
Function kirajumlahlewat()
jumodue = 0
Data9.RecordSource = "select * from hpoverdue"
Data9.Refresh
With Data9.Recordset 'hpoverdue table
Do Until .EOF
If ![saleno] = Label19 Then
jumodue = jumodue + Val(![overdue])
End If
.MoveNext
Loop
End With
If jumodue <= 0 Then
Label35 = "0.00"
Else
Label35 = Format(jumodue, "fixed")
End If
End Function
Function kirajumlahhutang()
Label31 = Format(Label25 ‐ Label40, "fixed") 'current balance
bakihutang = Val(Label31) + Val(Label35) 'total balance include overdue
If bakihutang <= 0 Then
Label44 = "0.00"
Else
Label44 = Format(bakihutang, "fixed")
End If
If Val(Label40) = 0 Then
bulandue = DateDiff("m", Label41, Date) + 1 'kira bulan hutang untuk bulanan jika m=0 kena +1
Else
bulandue = DateDiff("m", Label41, Date)
107
End If
End If
If bulandue > Val(Label26) Then 'cari jika bulandue besar daripada no instalment
bulandue = Label26 'jika bulandue besar jadi bulandue mesti =label26(no instalment)
End If
jumkenabayar = 0
jumkenabayar = Format(bulandue * Label29 ‐ Label40, "fixed") 'kira jumlah hutang selapas tolak bulanan
telah bayar
bulanhutang = bulandue ‐ Val(Label30) 'kira berapa bulan telah lewat
If bulanhutang <= 0 Then
Label45 = 0 'jika bulan tidak lewat
Else
Label45 = bulanhutang 'bulan telah lewat
End If
If jumkenabayar <= 0 Then
Label33 = "0.00"
Else
Label33 = Format(jumkenabayar, "fixed")
End If
End Function
Function lihathp()
carisno = "saleno=" & Label19 & ""
Data2.Refresh
With Data2.Recordset 'jual table
.FindFirst carisno
If .NoMatch Then
MsgBox "No such Vehicle No,Please try again", vbExclamation, "Search HP Information"
Text1.SetFocus
Else
Label20 = Format(![saledate], "ddddd")
Label21 = Format(![saleprice], "fixed")
Text2 = ![customercode]
casisno = ![chassisno]
caricno = "chassisno='" & casisno & "'"
Data4.Refresh
With Data4.Recordset 'vehicle table
.FindFirst caricno
If .NoMatch Then
Else
Label28 = ![model]
End If
End With
lihatpelanggan
carijualhp
lihatmula
kirasudahbayar
kirajumlahlewat
kirajumlahhutang
lihatdue
End If
End With
End Function
108
Function batal()
Text1 = ""
Text2 = ""
Text3 = ""
End Function
Private Sub cmdCancel_Click()
batal
Text1.SetFocus
End Sub
Private Sub cmdSearch_Click()
If Text2 = "" And Text3 = "" And Text1 <> "" Then
Data9.RecordSource = "select jualhp.SaleNo,VehicleNo,SaleDate,CustomerName " & _
"from jualhp,jualregno,jual,customer " & _
"where jualhp.saleno=jualregno.saleno " & _
"and jualhp.saleno=jual.saleno " & _
"and saletype='" & "HP" & "' " & _
"and jual.customercode=customer.customercode " & _
"and vehicleno='" & Text1 & "'order by jual.saleno"
ElseIf Text1 = "" And Text3 = "" And Text2 <> "" Then
Data9.RecordSource = "select jualhp.SaleNo,VehicleNo,SaleDate,CustomerName " & _
"from jualhp,jualregno,jual,customer " & _
"where jualhp.saleno=jualregno.saleno " & _
"and jualhp.saleno=jual.saleno " & _
"and saletype='" & "HP" & "' " & _
"and jual.customercode=customer.customercode " & _
"and customer.customercode='" & Text2 & "'order by vehicleno"
ElseIf Text1 = "" And Text2 = "" And Text3 <> "" Then
Data9.RecordSource = "select jualhp.SaleNo,VehicleNo,SaleDate,CustomerName " & _
"from jualhp,jualregno,jual,customer " & _
"where jualhp.saleno=jualregno.saleno " & _
"and jualhp.saleno=jual.saleno " & _
"and saletype='" & "HP" & "' " & _
"and jual.customercode=customer.customercode " & _
"and customer.customername like'" & Text3 & "*'order by vehicleno"
Else
Data9.RecordSource = "select jualhp.SaleNo,VehicleNo,SaleDate,CustomerName " & _
"from jualhp,jualregno,jual,customer " & _
"where jualhp.saleno=jualregno.saleno " & _
"and jualhp.saleno=jual.saleno " & _
"and saletype='" & "HP" & "' " & _
"and jual.customercode=customer.customercode order by vehicleno"
End If
Data9.Refresh
End Sub
Private Sub Command2_Click()
hirerfrm.Show
End Sub
Private Sub Command3_Click()
stafffrm.Show
End Sub
109
Private Sub Command4_Click()
vehiclefrm.Show
End Sub
Private Sub Command5_Click()
insuranfrm.Show
End Sub
Private Sub Command6_Click()
jualfrm.Show
End Sub
Private Sub Command7_Click()
Unload Me
End Sub
Private Sub Form_Load()
batal
pangkalan
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatvehicle
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
110
Sale Information
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Function pangkalan()
Data1.DatabaseName = App.Path + "\db1.mdb"
Data2.DatabaseName = App.Path + "\db1.mdb"
Data3.DatabaseName = App.Path + "\db1.mdb"
Data4.DatabaseName = App.Path + "\db1.mdb"
Data5.DatabaseName = App.Path + "\db1.mdb"
Data6.DatabaseName = App.Path + "\db1.mdb"
Data7.DatabaseName = App.Path + "\db1.mdb"
Data8.DatabaseName = App.Path + "\db1.mdb"
gabung
End Function
Function gabung()
Data1.RecordSource = "select * from jual order by saleno"
Data2.RecordSource = "select * from jualno"
Data3.RecordSource = "select * from jualhp"
Data4.RecordSource = "select * from jualregno"
Data5.RecordSource = "select * from fee"
Data6.RecordSource = "select * from termcharge"
Data1.Refresh
Data2.Refresh
Data3.Refresh
Data4.Refresh
Data5.Refresh
Data6.Refresh
End Function
Function simpanjual()
If Text1 = "" Then
MsgBox "Saving not allow,Please enter Sale No", vbCritical, "Saving Sale Information"
Text1.SetFocus
Else
cariin = "saleno=" & Text1 & ""
With Data1.Recordset 'jual table
.FindFirst cariin
If .NoMatch Then
.AddNew
With Data2.Recordset 'jualno table
.Edit
![InvoiceNo] = Text1
.Update
End With
Data2.Refresh
Else
.Edit
End If
![saleno] = Text1
![saledate] = Format(Text2, "dd/mm/yyyy")
![chassisno] = Text4
![cnote] = Text5
![saletype] = Format(Text6, ">")
111
![saleprice] = Text13
![remark] = Text17
![customercode] = Label18
.Update
Data1.Refresh
If Text6 = "HP" Then
simpanjualhp
End If
simpanjualregno
simpanfee
bar
batal
Text1.SetFocus
End With
End If
End Function
Function simpanjualhp()
cariin = "saleno=" & Text1 & ""
With Data3.Recordset 'jualhp table
.FindFirst cariin
If .NoMatch Then
.AddNew
Else
.Edit
End If
![saleno] = Text1
![hpmonth] = Text7
![interestrate] = Format(Text8, "fixed")
![hakmilik] = Format(Text9, "fixed")
![payment] = Format(Text14, "fixed")
![hptype] = Format(Text18, ">")
.Update
Data3.Refresh
End With
End Function
Public Sub simpanjualregno()
carien = "saleno=" & Text1 & ""
With Data4.Recordset 'jualregno table
.FindFirst carien
If .NoMatch Then
.AddNew
Else
.Edit
End If
![saleno] = Text1
![vehicleno] = Text3
.Update
Data4.Refresh
End With
End Sub
112
Function simpanfee()
cariin = "saleno=" & Text1 & ""
With Data5.Recordset 'fee table
.FindFirst cariin
If .NoMatch Then
.AddNew
Else
.Edit
End If
![saleno] = Text1
![regnfee] = Text10
![noplate] = Text11
![roadtax] = Text12
.Update
Data5.Refresh
End With
End Function
Function lihatjual()
If Text1 = "" Then
MsgBox "Searching not allow,Please enter Sale No", vbCritical, "Searching Sale Information"
Text1.SetFocus
Else
cariin = "saleno=" & Text1 & ""
Data1.Refresh
With Data1.Recordset 'jual table
.FindFirst cariin
If .NoMatch Then
Else
Text1 = ![saleno]
Text2 = Format(![saledate], "dd/mm/yyyy")
Text4 = ![chassisno]
Text5 = ![cnote]
Text6 = Format(![saletype], ">")
Text13 = ![saleprice]
Text17 = ![remark]
Label18 = ![customercode]
lihatjualhp
lihatjualregno
lihatfee
lihatterm
lihatcustomer
lihatvehicle
End If
End With
End If
End Function
Function lihatjualhp()
cariin = "saleno=" & Text1 & ""
Data3.Refresh
With Data3.Recordset 'jualhp table
.FindFirst cariin
113
If .NoMatch Then
Else
Text1 = ![saleno]
Text7 = ![hpmonth]
Text8 = Format(![interestrate], "fixed")
Text9 = Format(![hakmilik], "fixed")
Text14 = Format(![payment], "fixed")
Text18 = Format(![hptype], ">")
End If
End With
End Function
Public Sub lihatjualregno()
carien = "saleno=" & Text1 & ""
Data4.Refresh
With Data4.Recordset 'jualregno table
.FindFirst carien
If .NoMatch Then
Else
Text1 = ![saleno]
Text3 = ![vehicleno]
End If
End With
End Sub
Function lihatfee()
cariin = "saleno=" & Text1 & ""
Data5.Refresh
With Data5.Recordset 'fee table
.FindFirst cariin
If .NoMatch Then
Else
Text1 = ![saleno]
Text10 = ![regnfee]
Text11 = ![noplate]
Text12 = ![roadtax]
End If
End With
End Function
Function lihatterm()
cariin = "hpmonth=" & Text7 & ""
Data6.Refresh
With Data6.Recordset 'termcharge table
.FindFirst cariin
If .NoMatch Then
Else
Text19 = ![kadar]
End If
End With
End Function
114
Function lihatcustomer()
Data8.RecordSource = "select CustomerCode,CustomerName,NewIc " & _
"from customer,personal " & _
"where customer.customercode=personal.code " & _
"and (customercode='" & Label18 & "'or newic='" & Text16 & "')"
Data8.Refresh
carikod = "(customercode='" & Label18 & "' or newic='" & Text16 & "')"
With Data8.Recordset 'customer,personal tabel
.FindFirst carikod
If .NoMatch Then
Else
Label18 = Format(![customercode], ">")
Text15 = ![customername]
Text16 = ![newic]
End If
End With
End Function
Function lihatinsuran()
Data8.RecordSource = "select vehicleno,nett,insregno.cnote " & _
"from insharga,insregno " & _
"where insharga.cnote=insregno.cnote " & _
"and insregno.cnote='" & Text5 & "'"
Data8.Refresh
carikod = "cnote='" & Text5 & "'"
Data8.Refresh
With Data8.Recordset 'insharga table
.FindFirst carikod
If .NoMatch Then
Else
Text3 = Format(![vehicleno])
Label12 = Format(![nett], "fixed")
End If
End With
End Function
Function lihatvehicle()
Data8.RecordSource = "select chassisno,model " & _
"from vehicle " & _
"where chassisno='" & Text4 & "'"
Data8.Refresh
carikod = "chassisno='" & Text4 & "'"
With Data8.Recordset 'vehicle table
.FindFirst carikod
If .NoMatch Then
Else
Label7 = ![model]
End If
End With
End Function
Function hapus()
If Text1 = "" Then
MsgBox "Delete not allow! Please enter Invoice No", vbCritical, "DELETE INVOICE INFORMATION"
115
Text1.SetFocus
Else
caricn = "Invoice_no=" & Text1 & ""
With Data3.Recordset
.FindFirst caricn
If .NoMatch Then
Exit Function
Else
del = "Please Press [YES] for Delete this Record"
If MsgBox(del, vbDefaultButton2 + vbYesNo, "DELETE INVOICE INFORMATION") = vbYes Then
.Delete
Else
Text1.Enabled = True
batal
Text1.SetFocus
End If
End If
End With
Data3.Refresh
End If
End Function
Function batal()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
End Function
Private Sub cmdCancel_Click()
batal
Text1.SetFocus
End Sub
Private Sub cmdSave1_Click()
simpanjual
End Sub
Private Sub cmdSearch_Click()
If Text3 <> "" And Text16 = "" Then 'search by vehicleno
Data8.RecordSource = "select jual.SaleNo,SaleDate,SalePrice,VehicleNo,NewIc,CustomerName,CNote " & _
"from jual,jualregno,customer,vehicle,personal " & _
"where jual.customercode=customer.customercode " & _
"and jual.saleno=jualregno.saleno " & _
"and jual.chassisno=vehicle.chassisno " & _
"and customer.customercode=personal.code " & _
"and vehicleno='" & Text3 & "'order by jual.saleno desc"
ElseIf Text3 = "" And Text16 <> "" Then 'search by newic
Data8.RecordSource = "select jual.SaleNo,SaleDate,SalePrice,VehicleNo,NewIc,CustomerName,CNote " &
_
"from jual,jualregno,customer,vehicle,personal " & _
"where jual.customercode=customer.customercode " & _
"and jual.saleno=jualregno.saleno " & _
116
"and jual.chassisno=vehicle.chassisno " & _
"and customer.customercode=personal.code " & _
"and newic='" & Text16 & "' order by jual.saleno desc"
Else 'search all
Data8.RecordSource = "select
jual.SaleNo,SaleDate,SalePrice,VehicleNo,NewIc,CustomerName,CNote,saletype " & _
"from jual,jualregno,customer,vehicle,personal " & _
"where jual.customercode=customer.customercode " & _
"and jual.saleno=jualregno.saleno " & _
"and customer.customercode=personal.code " & _
"and jual.chassisno=vehicle.chassisno order by jual.saleno"
End If
Data8.Refresh
End Sub
Private Sub Command1_Click()
With jualresitfrm
.Text3 = Text1
.Label9 = Text13
.Text7 = Text3
.Label11 = Label18
.Label21 = Text15
.lihatbayar
.Show
End With
End Sub
Private Sub Command2_Click()
Text1 = Data2.Recordset![InvoiceNo] + 1
End Sub
Private Sub Command3_Click()
Data8.RecordSource = "select CustomerCode,NewIc,CustomerName " & _
"from customer,personal " & _
"where customer.customercode=personal.code " & _
"and customername like '" & Text15 & "*'order by customername"
Data8.Refresh
End Sub
Private Sub Command6_Click()
Text14 = Format(Text14, "fixed")
Label14 = Format(Text13 ‐ Text14, "fixed")
If Text7 = "" Then
Label15 = "0.00"
Else
Label15 = Format(Val(Label14) * Val(Text8) / 100 * Val(Text7) / 12, "fixed")
End If
Label19 = Format(Val(Label14) + Val(Label15), "fixed")
End Sub
Private Sub Command7_Click()
hpinfofrm.Show
Unload Me
End Sub
117
Private Sub DTPicker1_CloseUp()
Text2 = Format(DTPicker1, "dd/mm/yyyy")
Text5.SetFocus
End Sub
Private Sub Form_Load()
batal
DTPicker1 = Format(Date, "dd/mm/yyyy")
pangkalan
End Sub
Function tarikh()
If Text2 = "" Then
Else
Text2 = Format(Text2, "dd/mm/yyyy")
tahun = Year(Text2)
bulan = Month(Text2)
hari = Day(Text2)
bulan = bulan + 1
If bulan > 12 Then
tahun = tahun + 1
bulan = 1
End If
If bulan = 4 Or bulan = 6 Or bulan = 9 Or bulan = 11 Then
If hari > 30 Then
hari = 30
End If
End If
If bulan = 2 Then
If tahun Mod 4 = 0 Then
If hari > 28 Then
hari = 29
End If
Else
If hari > 28 Then
hari = 28
End If
End If
End If
Label63 = Format(tb, "dd/mm/yyyy")
End If
End Function
Private Sub mnukeluar_Click()
Unload Me
End Sub
Private Sub mnuresit_Click()
salepayfrm.Show
End Sub
Private Sub mnusimpan_Click()
simpanjual
End Sub
118
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatjual
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatvehicle: SendKeys vbTab
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatinsuran: SendKeys vbTab
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Keyascii=asc(ucase(chr((keyascii))))
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
119
Staff Information
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Function pangkalan()
Data1.DatabaseName = App.Path + "\db1.mdb"
gabung
End Function
Function gabung()
Data1.RecordSource = "select * from staff order by staffname"
Data2.RecordSource = "select * from personal order by newic"
Data3.RecordSource = "select * from alamat order by code"
Data4.RecordSource = "select * from poskod order by postcode"
Data5.RecordSource = "select * from negeri order by state"
Data6.RecordSource = "select * from fon order by code"
Data7.RecordSource = "select * from pword"
Data1.Refresh
Data2.Refresh
Data3.Refresh
Data4.Refresh
Data5.Refresh
Data6.Refresh
Data7.Refresh
End Function
Function simpanstaff() 'staff table
If Text1 = "" Then
MsgBox "Saving not allow! Please enter Code", vbCritical, "SAVING STAFF INFORMATION"
Text1.SetFocus
Else
carikod = "staffId='" & Text1 & "'"
With Data1.Recordset
.FindFirst carikod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![staffid] = Text1
![staffname] = Format(Text2, ">")
![salary] = Format(Text8, "fixed")
![employdate] = Format(Text10, "ddddd")
.Update
End With
Data1.Refresh
simpanpersonal
simpanalamat
simpanfon
simpanpword
bar
batal
kombocity
kombostate
kombokerja
120
End If
End Function
Function simpanpersonal()
carikod = "code='" & Text1 & "'"
With Data2.Recordset
.FindFirst carikod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![code] = Text1
![newic] = Text9
![Birthdate] = Format(Text5, "ddddd")
![Gender] = Format(Text12, ">")
![occupation] = Format(Text13, ">")
![statu] = Format(Text14, ">")
.Update
End With
Data2.Refresh
End Function
Function simpanalamat()
carikod = "code='" & Text1 & "'"
With Data3.Recordset
.FindFirst carikod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![code] = Text1
![Address] = Text3
![postcode] = Text4
.Update
End With
Data3.Refresh
simpanposkod
End Function
Function simpanposkod()
caripkod = "postcode='" & Text4 & "'"
With Data4.Recordset
.FindFirst caripkod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![postcode] = Text4
![City] = Text15
.Update
End With
121
Data4.Refresh
simpannegeri
End Function
Function simpannegeri()
carict = "city='" & Text15 & "'"
With Data5.Recordset
.FindFirst carict
If .NoMatch Then
.AddNew
Else
.Edit
End If
![City] = Text15
![State] = Text16
.Update
End With
Data5.Refresh
End Function
Function simpanfon()
carikod = "code='" & Text1 & "'"
With Data6.Recordset
.FindFirst carikod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![code] = Text1
![housephone] = Format(Text6, ">")
![handphone] = Format(Text7, ">")
.Update
End With
Data6.Refresh
End Function
Function simpanpword()
carikod = "code='" & Text1 & "'"
With Data7.Recordset
.FindFirst carikod
If .NoMatch Then
.AddNew
Else
.Edit
End If
![code] = Text1
![Password] = Text11
.Update
Data7.Refresh
End With
End Function
122
Function lihatstaff() 'staff table
If Text1 = "" Then
MsgBox "Searching not allow! Please enter Code", vbCritical, "SEARCHING STAFF INFORMATION"
Text1.SetFocus
Else
Data1.Refresh
carikod = "staffid='" & Text1 & "'"
With Data1.Recordset
.FindFirst carikod
If .NoMatch Then
Text2.SetFocus
Else
Text1 = ![staffid]
Text2 = Format(![staffname], ">")
Text8 = Format(![salary], "fixed")
Text10 = Format(![employdate], "ddddd")
lihatalamat
lihatfon
lihatpword
End If
End With
End If
End Function
Function lihatpersonal()
Data2.Refresh
cariic = "code='" & Text1 & "'"
With Data2.Recordset
.FindFirst cariic
If .NoMatch Then
Else
Text1 = ![code]
Text5 = Format(![Birthdate], "ddddd")
Text9 = Format(![newic], ">")
Text12 = ![Gender]
End If
End With
Data2.Refresh
End Function
Function lihatnewic()
Data2.Refresh
cariic = "newic='" & Text9 & "'"
With Data2.Recordset
.FindFirst cariic
If .NoMatch Then
kp
Else
Text1 = ![code]
Text5 = Format(![Birthdate], "ddddd")
Text9 = ![newic]
Text12 = ![Gender]
Data1.Refresh
With Data1.Recordset
123
.FindFirst carikod
If .NoMatch Then
Else
Text1 = ![staffid]
Text2 = Format(![staffname], ">")
Text8 = Format(![salary], "fixed")
Text10 = Format(![employdate], "ddddd")
End If
End With
End If
End With
Data2.Refresh
End Function
Function lihatalamat()
Data3.Refresh
carikod = "code='" & Text1 & "'"
With Data3.Recordset
.FindFirst carikod
If .NoMatch Then
Else
Text1 = ![code]
Text3 = ![Address]
Text4 = ![postcode]
lihatposkod
End If
End With
End Function
Function lihatposkod()
caripkod = "postcode='" & Text4 & "'"
Data4.Refresh
With Data4.Recordset
.FindFirst caripkod
If .NoMatch Then
Else
Text4 = ![postcode]
Text15 = ![City]
lihatnegeri
End If
End With
End Function
Function lihatnegeri()
Data5.Refresh
carict = "city='" & Text15 & "'"
With Data5.Recordset
.FindFirst carict
If .NoMatch Then
Else
Text15 = ![City]
Text16 = ![State]
End If
End With
124
Data5.Refresh
End Function
Function lihatfon()
Data6.Refresh
carikod = "code='" & Text1 & "'"
With Data6.Recordset
.FindFirst carikod
If .NoMatch Then
Else
Text1 = ![code]
Text6 = Format(![housephone], ">")
Text7 = Format(![handphone], ">")
End If
End With
End Function
Function lihatpword()
Data7.Refresh
carikod = "code='" & Text1 & "'"
With Data7.Recordset
.FindFirst carikod
If .NoMatch Then
Else
Text1 = ![code]
Text11 = ![Password]
End If
End With
End Function
Function lihatgrid()
Function hapus()
If Text1 = "" Then
MsgBox "Delete not allow! Please enter Staff ID", vbCritical, "DELETE STAFF INFORMATION"
Text1.SetFocus
Else
cari = "staffid='" & Text1 & "'"
Data1.Refresh
With Data1.Recordset
.FindFirst cari
If .NoMatch Then
Text1 = ""
Text1.SetFocus
Else
del = "Please Press [YES] for DELETE Staff Record"
If MsgBox(del, vbDefaultButton2 + vbYesNo, "DELETE STAFF RECORD") = vbYes Then
.Delete
batal
Text1.SetFocus
Else
batal
Text1.SetFocus
Exit Function
End If
125
End If
End With
Data1.Refresh
End If
End Function
Function kombocity()
Combo1.Clear
Data5.Refresh
With Data5.Recordset
Do Until .EOF
Combo1.AddItem ![City]
.MoveNext
Loop
End With
End Function
Function kombostate()
Combo2.Clear
Data5.RecordSource = "select distinct state from negeri order by state"
Data5.Refresh
With Data5.Recordset
Do Until .EOF
Combo2.AddItem ![State]
.MoveNext
Loop
End With
Data5.RecordSource = "select * from negeri order by city"
Data5.Refresh
End Function
Function kombokerja()
Combo4.Clear
Data2.RecordSource = "select distinct occupation from personal order by occupation"
Data2.Refresh
With Data2.Recordset
Do Until .EOF
Combo4.AddItem ![occupation]
.MoveNext
Loop
End With
Data2.RecordSource = "select * from personal"
Data2.Refresh
End Function
Function batal()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
End Function
126
Private Sub cmdCancel_Click()
batal
End Sub
Private Sub cmdDelete_Click()
hapus
End Sub
Private Sub cmdSave1_Click()
simpanstaff
End Sub
Private Sub cmdSearch_Click()
lihatgrid
End Sub
Private Sub Command5_Click()
lihatgrid
End Sub
Private Sub Command7_Click()
Unload Me
End Sub
Private Sub DTPicker1_CloseUp()
Text5 = Format(DTPicker1, "dd/mm/yyyy")
End Sub
Private Sub DTPicker2_CloseUp()
Text10 = Format(DTPicker2, "ddddd")
End Sub
Private Sub Form_Load()
batal
DTPicker1 = Format(Date, "dd/mm/yyyy")
DTPicker2 = Format(Date, "dd/mm/yyyy")
pangkalan
kombokerja
kombocity
kombostate
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatstaff
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
127
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then lihatposkod: SendKeys vbTab
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
128
Vehicle Information
Function pangkalan()
Data1.DatabaseName = App.Path + "\db1.mdb"
Data2.DatabaseName = App.Path + "\db1.mdb"
Data3.DatabaseName = App.Path + "\db1.mdb"
gabung
End Function
Function gabung()
Data1.RecordSource = "select * from vehicle"
Data2.RecordSource = "select * from vehsub"
Data1.Refresh
Data2.Refresh
End Function
Function simpanvehicle()
If Text6 = "" Then
Else
cari = "chassisno='" & Text6 & "'"
With Data1.Recordset 'vehicle table
.FindFirst cari
If .NoMatch Then
.AddNew
Else
.Edit
End If
![model] = Format(Text3, ">")
![colour] = Format(Text4, ">")
![chassisno] = Text6
![engineno] = Text7
![yearmake] = Text8
![cc] = Text9
.Update
Data1.Refresh
simpanvehsub
bar
batal
kombomake
kombomodel
kombocolor
kombobody
Text2.SetFocus
End With
End If
End Function
Function simpanvehsub()
cari = "model='" & Text3 & "'"
With Data2.Recordset 'vehsub
.FindFirst cari
If .NoMatch Then
.AddNew
Else
129
.Edit
End If
![body] = Text1
![make] = Text2
![model] = Text3
![oil] = Text5
.Update
Data2.Refresh
End With
End Function
Function lihatvehicle()
If Text6 = "" Then
Text6.SetFocus
Else
caricn = "chassisno='" & Text6 & "'"
With Data1.Recordset 'vehicle
.FindFirst caricn
If .NoMatch Then
Text7.SetFocus
Else
Text3 = ![model]
Text4 = ![colour]
Text6 = ![chassisno]
Text7 = ![engineno]
Text8 = ![yearmake]
Text9 = ![cc]
lihatvehsub
Text7.SetFocus
End If
End With
End If
End Function
Function lihatvehsub()
cari = "model='" & Text3 & "'"
Data2.Refresh
With Data2.Recordset 'vehsub
.FindFirst cari
If .NoMatch Then
Else
Text1 = ![body]
Text2 = ![make]
Text3 = ![model]
Text5 = ![oil]
End If
End With
End Function
Function hapus()
If Text6 = "" Then
MsgBox "Delete not allow, Please enter Chassis No", vbCritical, "Delete Vehicle Information"
Text6.SetFocus
Else
130
del = "Are you sure Delete this record,Please [YES] for Delete this record"
If MsgBox(del, vbDefaultButton2 + vbYesNo + vbInformation, "") = vbYes Then
cariveh = "chassisno='" & Text6 & "'"
Data1.Refresh
With Data1.Recordset
.FindFirst cariveh
If .NoMatch Then
Else
.Delete
Data1.Refresh
End If
End With
Else
batal
Text1.SetFocus
End If
End If
End Function
Function kombobody()
Combo1.Clear
Data3.RecordSource = "select distinct body from vehsub order by body"
Data3.Refresh
With Data3.Recordset
Do Until .EOF
Combo1.AddItem ![body]
.MoveNext
Loop
End With
End Function
Function kombomake()
Combo2.Clear
Data3.RecordSource = "select distinct make from vehsub order by make"
Data3.Refresh
With Data3.Recordset
Do Until .EOF
Combo2.AddItem ![make]
.MoveNext
Loop
End With
End Function
Function kombomodel()
Combo3.Clear
Data3.RecordSource = "select * from vehsub order by model"
Data3.Refresh
With Data3.Recordset
Do Until .EOF
If ![make] = Text2 Then
Combo3.AddItem ![model]
End If
.MoveNext
Loop
131
End With
End Function
Function kombocolor()
Combo4.Clear
Data3.RecordSource = "select distinct colour from vehicle order by colour"
Data3.Refresh
With Data3.Recordset
Do Until .EOF
Combo4.AddItem ![colour]
.MoveNext
Loop
End With
End Function
Function batal()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
End Function
Private Sub cmdCancel_Click()
batal
End Sub
Private Sub cmdDelete_Click()
hapus
End Sub
Private Sub cmdSave1_Click()
simpanvehicle
End Sub
Private Sub cmdSearch_Click()
If Text3 <> "" Then
Data3.RecordSource = "select ChassisNo,Model,EngineNo,YearMake,CC " & _
"from vehicle where model='" & Text3 & "'order by model"
Else
Data3.RecordSource = "select ChassisNo,Model,EngineNo,YearMake,CC from vehicle order by model"
End If
Data3.Refresh
End Sub
Private Sub Command7_Click()
Unload Me
End Sub
Private Sub Form_Load()
batal
pangkalan
kombobody
kombomake
132
kombocolor
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) '
If KeyCode = 13 Then Text3.SetFocus
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr((KeyAscii))))
End Sub
133