You are on page 1of 135

INTRODUCTION:

Main aim in developing Hotel Management System is to provide an easy way not only to automate all functionalities of a hotel, but also to provide full functional reports to top management of hotel with the finest of details about any aspect of hotel We are committed to bring the best way of management in the various forms of Hotel Management System. We understand that Hotel Management System is not a product to be sold, it is a bridge between the Hotel and Customers. So we can say the Core purpose of designing Hotel Management System is to manage the tasks related to the hotel customers/employees and to reduce time to prepare computerized check out and food bills.

SCOPE OF THE SYSTEM


This system provides the detail structure of the hotel and its various departments. HMS synchronizes the working of all the departments. It looks on all aspects of a hotel, its rooms, facilities, food, Departments, customer details and other hotel activities. HMS is the easiest way to manage all functionalities of a hotel, which facilitates hotels to maintain the functionality related to hotel rooms and their customers.

BENEFITS:
Following are the benefits for using Hotel Management System :

For Employees:
Collective records of all the guests including regular guests. Collective records of employees of all departments , their attendance, payroll etc. Easy approach to find the detail information for any customer/employee. Easy to handle all functionality of hotel. Easy to manage all actions (generating check out bill, food bill etc). All information can be synchronized in one place and distribute to a particular department to manage properly. HMS is beneficial for both customers/employees only in the way that they can get all previous or current information's when they need. It is helpful to maintain the customers and employees record (total number of rooms available,check out bill,food bill,payroll system of employees). 2

Employees do not maintain the file, documentation, reports

(customerwise,roomwise)

For Customers:
Easy to check about various rooms available in hotel, their rents etc. Easy to query all related details of hotel about its rooms, food, drinks and other facilities available Easy to generate full details about the hotel.

ADVANTAGES:
By using this s/w, you can learn how you prepare your records in standard manner. Also you can find the check out bills,food bills and current status related to any customer or employees. By using this s/w, administrator can manage all records in standard manner. Also it can help to get all or a particular customer or employee information in a standard manner. Also it can help to maintain the check out bill, food bill and payroll reports of hotel in proper way. It helps to generate payroll of employees and full check out details and food billing details of the customers.

SYSTEM STUDY
A detailed study of the existing system is necessary. The functions of the system, requirements for the users, structure of the current system is made through the system study. The problems faced in the current system are found and solution pertaining to it is done in the system study.

EXISTING SYSTEM:
In the existing system, the manual process, receiving datas from hotel staff and staff details are done through manual records. These records are entered in manual process. In this process will take long time, separate workers need to maintaining the databases. All the hotel details are stored via separate databases. It will take long time due to this process time waste, money waste etc... In this process very difficult to maintain the check out details and accounting reports of hotel in proper way. Hotel staff does not maintain the file, documentation, reports (month Wise, year wise) etc

NEED FOR PROPOSED SYSTEM


The main objective of the existing system is to provide a userfriendly interface. The system, which is proposed, now computerizes all the details that are maintained manually. Once the details are fed into the computer there is no need for various persons to deal with separate sections. Only a single person is enough to maintain all the reports. The security can also be given as per the requirement of the user

Large volumes of data can be stored with case. Maintenance of file is flexible. Records stored are updated now and then. Stored data and procedures can be easily edited. Reports can be generated with case. Accurate calculations are made. Less manpower required The main modules involved in this system are:

1) Login The different types of users in login are : a)Admin b)Student c)Employee 2)Forms This module consists of the following sub modules: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Check In Form Check Out Form Search Guest Search Employee Status Of Hotel Make Payment Process Payroll Make Reservation Bar Laundry Services Daily Evaluation Report Other Utilities such as Notepad,Calculator,Control Panel etc.

3)Reports:
5

The Following are the reports can be taken from this system 1. 2. 3. Daily Evaluation Report Check Out Report Food Report

SYSTEM SPECIFICATION
HARDWARE CONFIGURATION
The hardware used for the execution of the project is: PROCESSOR RAM MONITOR HARD DISK FLOPPY DRIVE CDDRIVE KEYBOARD MOUSE : : : : : : : : PENTIUM III 866 MHz 128 MD SD RAM 15 COLOR 20 GB 1.44 MB LG 52X STANDARD 102 KEYS 3 BUTTONS

SOFTWARE CONFIGURATION

The software used for the execution of the project is: OPERATING SYSTEM LANGUAGE BACKEND : : : Windows XP Professional Visual Basic.6.0 Ms-Access

MICROSOFT ACCESS
Microsoft Access

Office Access 2003 running on Microsoft Windows XP. Developer(s) Initial release Stable release Operating system Type License Website Microsoft 1.0 / November 1992 12.0.6425.1000 (2007 SP2) / April 28, 2009; 9 month(s) ago Microsoft Windows RDBMS Proprietary EULA http://office.microsoft.com/access

Microsoft Office Access, previously known as Microsoft Access, is a retaional database management system from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software development tools. It is a member of the Microsoft Office suite of applications, included in the Professional and higher editions or sold separately. Access stores data in its own format based on the Access Jet Database Engine. It can also import or link directly to data stored in other Access databases, Excel, SharePoint lists, text, XML, Outlook, HTML, dBase, Paradox, Lotus 1-2-3, or any ODBC-compliant data container, including Microsoft SQL Server, Oracle, MySQL and PostgreSQL.Software developers and data architects can use it to develop application software, and "power users" can use it to build simple application. Like other Office applications, Access is supported by Visual Basic for Applications, an object-orientedprogramming language that can reference a variety of objects including DAO (Data Access Objects), ActiveX Data Objects, and many other ActiveX components. Visual objects used in forms and reports expose their methods and properties in the VBA programming environment, and VBA code modules may declare and call Windows operating system functions. VBA with .NET_Framework can be considered a successor to Access in the sense that it can produce web front-ends for databases and includes much of the functionality of VBA in Access. 8

USES
Microsoft Access is used to create simple database solutions. Access tables support a variety of standard field types, indices, and referential integrity. Access also includes a query interface, forms to display and enter data, and reports for printing. The underlying Jet database, which contains these objects, is multiuseraware and handles record-locking and referential integrity including cascading updates and deletes. Simple tasks can be automated through macros with point-andclick options. Microsoft Access is very popular among nonprogrammers who can create visually pleasing and relatively advanced solutions on their own. It is also easy to place a database on a network and have multiple users share and update data without overwriting each others work. Data is locked at the record level which is significantly different from Excel which locks the entire spreadsheet. Microsoft offers a wide range of template databases within the program and for download from their website. These options are available upon starting Access and allow users to quickly use and enhance a database with pre-defined tables, queries, forms, reports, and macros. Popular templates include tracking contacts, assets, issues, events, projects, and tasks. Templates do not include VBA code. Microsoft Access also offers the ability for programmers to create solutions using the programming language Visual Basic for Applications (VBA), which is similar to Visual Basic 6.0 (VB6) and used throughout the Microsoft Office programs such as Excel, Word, Outlook and PowerPoint. Most VB6 code including the use of Windows API calls,can be used in VBA. Power users and developers can extend basic end-user solutions to a professional solution with advanced automation, data validation, error trapping,

and multi-user support. Database solutions created entirely in Microsoft Access are well suited for individual and workgroup use across a network. The number of simultaneous users that can be supported depends on the amount of data, the tasks being performed, level of use, and application design. Generally accepted limits are solutions with 1 GB or less of data (Access supports up to 2 GB) and 50 or fewer simultaneous users. This is appropriate for workgroup and department solutions where the total number of users number a few hundred. Applications that simply view data or have simple data entry can support considerably more users. Applications that run complex queries or analysis across large datasets would naturally require greater bandwidth and memory. Microsoft Access is designed to scale to support more data and users by linking to multiple Access databases or using a back-end database like Microsoft SQL Server. With the latter design, the amount of data and users can scale to enterprise-level solutions. Microsoft Access' role in web development prior to version 2010 is limited. User interface features of Access, such as forms and reports, only work in Windows. The Microsoft Jet Database Engine, core to Access, can be accessed through technologies such as ODBC or OLE DB. The data (i.e., tables and queries) can be accessed by web-based applications developed in ASP.NET, PHP, or Java. Many ISPs offer Microsoft Access as a data storage option. In enterprise environments, Microsoft Access is particularly appropriate for meeting end-user database needs and for rapid application development. Microsoft Access is easy enough for end users to create their own queries, forms and reports, laying out fields and groupings, setting formats, etc. This frees up the professional developers to focus on more complex portions of the application.

10

FEATURES:
Users can create tables, queries, forms and reports, and connect them together with macros. Advanced users can use VBA to write rich solutions with advanced data manipulation and user control. The original concept of Access was for end users to be able to access data from any source. Other uses include: the import and export of data to many formats including Excel, Outlook, ASCII, dBase, Paradox, FoxPro, SQL Server, Oracle, ODBC, etc. It also has the ability to link to data in its existing location and use it for viewing, querying, editing, and reporting. This allows the existing data to change and the Access platform to always use the latest data. It can perform heterogeneous joins between data sets stored across different platforms. Access is often used by people downloading data from enterprise level databases for manipulation, analysis, and reporting locally. There is also the Jet Database format (MDB or ACCDB in Access 2007) which can contain the application and data in one file. This makes it very convenient to distribute the entire application to another user, who can run it in disconnected environments. One of the benefits of Access from a programmer's perspective is its relative compatibility with SQL (structured query language) queries can be viewed graphically or edited as SQL statements, and SQL statements can be used directly in Macros and VBA Modules to manipulate Access tables. Users can mix and use both VBA and "Macros" for programming forms and logic and offers objectoriented possibilities. VBA can also be included in queries. Microsoft Access offers parameterized queries. These queries and Access tables can be referenced from other programs like VB6 and .NETthrough DAO or ADO. From Microsoft Access, VBA can reference parameterized stored procedures via ADO.

11

The desktop editions of Microsoft SQL Server can be used with Access as an alternative to the Jet Database Engine. This support started withMSDE (Microsoft SQL Server Desktop Engine), a scaled down version of Microsoft SQL Server 2000, and continues with the SQL Server Express versions of SQL Server 2005 and 2008. Microsoft Access is a file server-based database. Unlike clientserver relational database management systems (RDBMS), Microsoft Access does not implement database triggers, stored procedures, or transaction logging. Access 2010 (not released) does have table level triggers and stored procedures built into the ACE data engine.

12

VISUAL BASIC
VISUAL BASIC is a high level programming language which was evolved from the earlier DOS version called BASIC. It is an object oriented programming system for creating application that run under any of the Microsoft Windows environments. It has following two major components: An extensive collection of prewritten tools, called controls. These controls are accessible as icons within a graphical programming environment for creating customized windows components ( e.g. menus, dialog boxes, text boxes, slide bars etc) A complete set of program commands, derived from Microsofts implementation of the classical Basic Programming language. The command set includes features that embrace contemporary programming practice. The over all approach to Visual Basic Programming is two fold: Create a user interface that is appropriate to the particular application at hand. Add a group of basic instruction to carry out the actions associated with each of the controls.

The Development Environment


Learning the ins and outs of the Development Environment before you learn visual basic is somewhat like learning for a test you must know where all the functions belong and what their purpose is. First we will start with labeling the development environment.

13

The above diagram shows the development environment with all the important points labeled.

The project explorer window


The Project explorer window gives you a tree-structured view of all the files inserted into the application. You can expand these and collapse branches of the views to get more or less detail (Project explorer). The project explorer window displays forms, modules or other separators which are supported by the visual basic like class'es and Advanced Modules. If you want to select a form on its own simply double click on the project explorer window for a more detailed look. And it will display it where the Default form is located.

14

Properties Window

The Default Layout


When we start Visual Basic, we are provided with a VB project.A VB project is a collection of the following modules and files.

The global module( that contains declaration and procedures) The form module(that contains the graphic elements of the VB application along with the instruction ) The general module (that generally contains generalpurpose instructions not pertaining to anything graphic onscreen)

The class module(that contains the defining characteristics of a class, including its properties and methods) The resource files(that allows you to collect all of the texts and bitmaps for an application in one place)

On start up, Visual Basic will displays the following windows :


The Blank Form window The Project window The Properties window

It also includes a Toolbox that consists of all the controls essential for developing a VB Application. Controls are tools such as boxes, buttons, labels and other objects draw on a form to get input or display output.
15

They also add visual appeal.

Understanding the tool box.


You may have noticed that when you click on different controls the Properties Window changes slightly this is due to different controls having different functions. Therefore more options are needed for example if you had a picture then you want to show an image. But if you wanted to open a internet connection you would have to fill in the remote host and other such settings. When you use the command ( ) you will find that a new set of properties come up the following will provide a description and a property.

Running and viewing the project in detail


Once an application is loaded it can be run by click on the from the toolbar, to pause press and to terminate use . icon

Once a project is loaded, the name of the form(s) that it contains is displayed in the project window. To view a form in design mode, select the form required by clicking with the mouse to highlight its name, then clicking on the view form button.

16

In this example the project has been loaded and the maillist.frm has been selected for viewing. This Ms Mail example project uses 6 forms and 1 modules. In Design mode, when the form is viewed, the code attached to any screen object may be inspected by double clicking on that object. The screen shots below show the interface of the Ms Mail example (.../samples/Comtool/VBMail/MaiLLST.FRM) to view the code for this form select from the project window item.

WHY VISUAL BASIC:


Like the BASIC programming language, Visual Basic was designed to be easy to learn and use. The language not only allows programmers to create simple GUI applications, but can also develop complex applications. Programming in VB is a combination of visually arranging components or controls on a form, specifying attributes and actions of those components, and writing additional lines of code for more functionality. Since default attributes and actions are defined for the components, a simple program can be created without the programmer having to write many lines of code.

ADVANTAGES:
1)

It's simple language. Things that may be difficult to program with language, Can be done in Visual Basic very easily.

other

2) Because Visual Basic is so popular, there are many good 17

resources (Books, Web sites, News groups and more) that can help you learn the language. You can find the answers to your programming problems much more easily than other programming languages. 3) You can find many tools (Sharewares and Freewares) on the internet that will Spare you some programming time. For example, if you want to ping a user over the internet in your program, Instead of writing the ping function yourself, you can download a control that does it, and use it in your program. Compare to other languages, Visual Basic have the widest variety of tools that you can download on the internet and use in your programs.

18

DATABASE:
The conventional data processing approach is to develop a program (or many programs) for each application. This result in one or more data files for each application. Some of the data may be common between files. However one application may require the file to be organized on a particular field, while other application may require the file to be organized on another field. A major drawback of the conventional method is that the storage access methods are built in to the program. Therefore, though the same data may be required by two applications, the data will have to be sorted in two different places because each application depends on the way that the data stored. There are various drawbacks of conventional data file processing environment. Some of them are listed below: 1)Data Redundancy: 2)Data Integrity Problems: 3)Data Availability Constraints: 4)Database Management System

Defining the structures for the storage of data Providing the mechanisms for the manipulation of the data Providing for the security of the data against unauthorized access

Users of the DBMS:


Broadly, there are three types of DBMS users: The application programmer The end user The database administrator (DBA) 19

The application programmer writes application programs that use the database. These programs operate on the data in the database. These operations include retrieving information, inserting data, deleting or changing data. The end user interacts with the system either by invoking an application program or by writing their queries in a database query language. The database query language allows the end user to perform all the basic operations (retrieval, deletion, insertion and updating) on the data. The DBA has to coordinate the functions of collecting information about the data to be stored, designing and maintaining the database and its security. The database must be designed and maintained to provide the right information at the right time to authorized people. These responsibilities belong to the DBA and his staff.

ADVANTAGES OF A DBMS
The major advantage that the database approach has over the conventional approach is that a database system provides centralized control of data. Most benefits accrue from this notion of centralized control.

1)REDUNDANCY CAN BE CONTROLLED 2)INCONSISTENCY CAN BE AVOIDED 3)THE DATA CAN BE SHARED 4)STANDARDS CAN BE ENFORCED 5)SECURITY RESTRICTIONS CAN BE APPLIED 6)INTEGRITY CAN BE MAINTAINED 7)DATA INDEPENDENCE

20

FEATURES OF RDBMS:

The ability to create multiple relations and enter data into them An interactive query language Retrieval of information stored in more than one table

NORMALIZATION
Normalization is a process of simplifying the relationship between data elements in a record. It is the transformation of complex data stores to a set of smaller, stable data structures. Normalized data structures are simpler, more stable and are easier to maintain. Normalization can therefore be defined as a process of simplifying the relationship between data elements in a record.

PURPOSE FOR NORMALIZATION


Normalization is carried out for the following four reasons: To structure the data so that there is no repetition of data, this helps in saving space.

To permit simple retrieval of data in response to query and report requests. To simplify the maintenance of the data through updates, insertions and deletions. To reduce the need to restructure or reorganize data when new application requirements arise.

21

STEPS OF NORMALIZATION:
Systems analysts should be familiar with the steps in normalization, since the process can improve the quality of design for an application. Starting with a data store developed for a data dictionary the analyst normalized a data structure in three steps. Each step involves an important procedure to simplify the data structure. It consists of basic three steps. 1. First Normal Form, which decomposes all data groups into two-dimensional records. 2. Second Normal form, which eliminates any relationships in which data elements do not fully depend on the primary key of the record. 3. Third Normal Form which eliminates any relationships that contain transitive dependencies. Fig 3.2 steps involved in the process of normalization

User Views/ Un-normalized Relations Step 1: Remove repeating groups. Fix record Step 2 : Removal of data items which are not Step 3 : Removal of transitive dependencies.

First Normal Form

Second Normal Form Third Normal Form

22

The relation obtained from the data store such as Employee Register will most likely be un-normalized. It will consist of repeating groups and record will not be of fixed length.

User

User Validatio n

Hotel

Student_DB

Stude nt Detail s Staff Detail s Reports

Cours e Detail s

Course_DB

Staff_DB

Staff Reports

Daily

Stock

Examination

Fees

23

RECOGNITION OF NEED:
One must know what the problem is before it can be solved. The basis for a candidate system is recognition of need for improving an information system or a procedure. Under this stage preliminary survey or initial investigation is done to know what is the problem. Thus during this phase problems with the current system(manual or automated) are identified and also the benefits and costs of an alternative system are identified. This is simply a report a formal document detailing the nature and scope of the proposed solution. The proposal summarizes what is known and what is going to be done. It consists of the following: 1) statement of the problem 2) summary of findings and recommendations 3) details of findings 4) recommendations and conclusions

In our project it was found that the college records were recorded manually. The initial investigation was done to know about the problems that were faced by keeping manual records of the college. Taking into consideration all the problems of manual system it was decided to develop the automated system for the college management.

24

FEASIBILITY STUDY:
The next step after the initial investigation is the feasibility study. The feasibility study is the determination of whether or not the project is worth doing. This type of study determines if a project can be taken. Generally feasibility studies are undertaken within tight time constraints and normally culminates in written or oral feasibility report. The contents and recommendations of such a study will be used as a sound basis for deciding whether to proceed, postpone or cancel the project. All projects are feasible given unlimited resources and infinite time. Unfortunately the development of a computer-based system is more likely to be plagued by scarcity of resources & difficult delivery dates. It is both necessary and prudent to evaluate the feasibility of a project at the earliest possible time. Concentration has been done on three primary areas of interest namely economic feasibility, technical and organizational & operational feasibility. All these three have been discussed in the following text. An extensive feasibility study was conducted to see all the areas and gauge that the project is feasible from all sides. The feasibility study has been divided into three major parts namely.

1)TECHNICAL FEASIBILITY:
Technical feasibility is concerned with specifying equipment and
software that will successfully satisfy the user requirement. Technical feasibility centers around the existing computer system(hardware, software,etc).

25

2)OPERATIONAL FEASIBILITY: The operational feasibility is related to human, organizational and political aspects. The points to be considered in operational feasibility are: Does the Organization have resources needed to make this project a success? Will the end user be able to understand and use it to its full capacity? If not does the management has enough resources to train them?

3)ECONOMIC FEASIBILITY: The project is considered economically feasible on the basis of funds available for the making and maintenance of the project and also the available resources were enough to install the initial phases of the project with a little extra hardware, again, which is not costly. More commonly known as cost-benefit analysis, the procedure is to determine the benefits and savings that are expected from a proposed system and compare them with costs. Therefore the main question to be asked in economic feasibility is: How much will the system cost? Development cost Operational cost Maintenance and support cost

26

ANALYSIS
Analysis is the detailed study of the various operations performed by the system and their relationships within and outside the system. This is the period when the development team collects information from users, management, and data processing personnel regarding the proposed system and the environment in which it will operate, then analyzes the information in order to understand, specify and document requirements specifications. During analysis data are collected on the available files, decision points, and transactions handled by the present system. The data flow diagrams, interviews, on-site observations, E-R diagrams are examples of some logical system models and tools that are used in analysis.
DATA FLOW DIAGRAM:

First Level DFD

Student

Request

Roll No. Allotment

Detail Basic Detail


STUDENT MGMT SYSTEM

Student Info Roll No Info Trasaction Detail

Cash Student Detail

27

IInd Level DFD Student Request Detail Cash


Fees Deposit

Fee Withdrw

Basic Detail

Student Info

BANK

Checking

Cash Account Detail

Info

Transaction Detail

28

DESIGN:
The most creative and challenging phase of the system life cycle is system design. In system design we move from the logical to the physical aspects of the life cycle. The term design describes a final system and the process by which it is developed. It refers to the technical specification that will be applied in implementing the candidate system.

The strategy of design includes: -

1.) BOTTOMUP APPROACH:


This approach decides how to combine the modules to provide larger ones. To combine even larger ones till we arrive at one big module, which is the whole of desired program. The design processes from bottom layer to upward layer and is called bottom up design. If we start coding a module soon after its design the chances of recording is high but the coded modules can be tested and design, can be validated sooner than a module, whose sub module has not yet be design. This method has one weakness; we need to use a lot of intuition to decide exactly what functionally a module should provide. If it at the higher level the design is not required than we need to change the low level modules.

2.) TOP DOWN APPROACH: The idea of top down design is that, specification is just as describing the black box for the program. The designer should decide how the intervals of the black box are constructed from smaller black boxes. Thus, top down design approach starts by identifying the major modules of the system decomposing them into their lower level modules at interacting until the desired level of detail is achieved. This is stepwise defilement starting

29

from an abstract design. Most design methodologies are based on this approach and are suitable if specifications are clear and development is from the beginning. If coding of a part starts soon after its design nothing can be tested until all its subordinate modules are coded.

INPUT DESIGN:Inaccurate input data are the most common cause of errors in data processing. Errors entered by data entry operators can be controlled by input design. Input design is the process of converting user originated inputs to a computer based format. In the system design phase, the expanded data flow diagram identifies logical data flows, data stores, sources, and destination. A systems flowchart specifies flowchart master files (data base), transactions files, and computer programs. Input data are collected and organized into groups of similar data. Once identified, appropriate input media are selected for processing.

OUTPUT DESIGN:Computer output is the most important and direct source of information to the user. Efficient, intelligible output design should improve the systems relationships with the user and help in decision making. A major form of output is a hard copy from the printer. Printouts are designed around the output requirements. Factors for the output devices are compatibility of the device with the system, response time requirements, expected print quality, and the number of copies needed.

30

FILE DESIGN:The most important aspect of building candidate systems is file design. After the input, output, and various forms are designed, files and the data they store must be organized according to user requirements and the constraints of the hardware and operating system. Some applications are processed daily and affect each record in the file. Such records are handled in sequential order when tape is the appropriate medium. In contrast, records that are updated, accessed, or retrieved at random are stored on disks or diskettes. A file is organized to ensure that records are available for processing. It is designed in the line with the activity and volatility of the information and the nature of the storage media and devices. Other consideration is: 1.) Cost of file media. 2.) Inquiry requirements File privacy, integrity, security, and confidentiality

DATA RELATED TO USERS


The table contains the following users and passwords

31

TABLE STRUCTURE The project consists of following tables: CHECK IN TABLE:

CHECK OUT TABLE:

32

COMPANY TABLE:

DELETED EMPLOYEE TABLE:

PAYMENT LOG TABLE

PAYMENT TABLE:

33

PAYROLL LOG TABLE:

PAYROLL TABLE:

RESERVATION TABLE:

34

ABOUT NOTEPAD:

Notepad is a simple text editor for Microsoft Windows. It has been included in all versions of Microsoft Windows since Windows 1.0 in 1985. Features Notepad is a common text-only (plain text) editor. The resulting filestypically saved with the .txt extensionhave no format tags or styles, making the program suitable for editing system files that are to be used in a DOS environment. Notepad supports both left-to-right and right-to-left based languages, and one can alternate between these viewing formats by using the right or left Ctrl+Shift keys to go to right-to-left format or left-to-right format, respectively. Unlike WordPad, Notepad does not treat newlines in Unix- or Mac-style text files correctly. Early versions of Notepad offered only the most basic functions, such as finding text. Newer versions of Windows include an updated version of Notepad with a search and replace function (Ctrl + H), as well as Ctrl + F for search and similar keyboard shortcuts. Notepad makes use of a built-in window class named "EDIT". In older versions such as those included with Windows 95, Windows 98, Windows Me and Windows 3.1, there is a 64k limit on the size of the file being edited, an operating system limit of the EDIT class. Up to Windows 95, Fixedsys was the only available font for Notepad. Windows NT 4.0 and 98 introduced the ability to change this font. As of Windows 2000, the default 35

font was changed to Lucida Console. Up to Windows Me, there were almost no keyboard shortcuts and no line-counting feature. Starting with Windows 2000, shortcuts for common tasks like new, open and save were added, as well as a status-bar with a line counter (available only when word-wrap is disabled). In the Windows NT-based versions of Windows, Notepad can edit traditional 8-bit text files as well as Unicode text files (both UTF-8 and UTF-16, and in case of UTF16, both little-endian and big-endian). Notepad also has a simple built-in logging function. Each time a file that starts with .LOG is opened, the program inserts a text timestamp on the last line of the file.[1][2] Notepad accepts text from the Windows clipboard. When clipboard data with multiple formats is pasted into Notepad, the program will only accept text in the CF_TEXT format.[3] This is useful for stripping embedded font type and style codes from formatted text, such as when copying text from a web page and pasting into an email message or other WYSIWYG text editor. The formatted text is temporarily pasted into Notepad, and then immediately copied again in stripped format to be pasted into the other program. Simple text editors like Notepad may be used to edit text with markup, such as HTML. However, because they lack many features (such as syntax highlighting), web developers may favor more specialized editors for this purpose

ABOUT CALCULATOR:

Windows Calculator, commonly known as Calculator from the application's title bar, is a calculation application included in all versions of the Microsoft Windows operating system. It can be activated by the command "calc" on most Windows systems. Features

Windows Vista and earlier

36

Scientific mode in Windows Vista In Windows versions before Windows 7, Calculator has a simplified interface, small size, and can perform all of the functions of most four-function or scientific calculators. By default, the application is in the "Standard" mode, and functions as a four-function calculator. More advanced functions are available in "Scientific" mode, including logarithms, numerical base conversions, some logical operators, operator precedence, radian, degree and gradians support as well as simple single-variable statistical functions. It does not provide support for user-defined functions, complex numbers, storage variables for intermediate results (other than the classic accumulator memory of pocket calculators), automated polar-cartesian coordinates conversion, or support two-variables statistics, making it impractical to use with many engineering, physics or high school mathematics tasks. Calculator is not able to do "constant calculations". Using common stand-alone calculator, when a user wants to apply the same constant and operation many times, the second and following calculations can be done without retyping the operation and constant. So one can type: 2*7=[14] 3=[21] 4=[28] etc.. Some versions of Calculator have a way to automate long calculations. Writing a text file in Notepad or another text editor containing a number at the beginning and then an operator and other numbers and operators following it and pasting the resultant content to Calculator's textbox will result in it performing the so described calculations. This may not work correctly with all versions of Calculator, and depends on precise text formatting. Some keyboards have a "calculator" key, which launches Windows Calculator by default. Most of Calculator's functions can be accessed with a specific letter or symbol or other keystroke sequence. A full list of Calculator functions and explanations of the functions can be found in Calculator's help file.

Hex Mode Limitation and Behavior


Calculator in "Hex" (hexadecimal) mode cannot accept or display a hexadecimal number larger than X'FFFFFFFFFFFFFFFF' (decimal 18446744073709551615). That 8-byte (64-bit) limit, combined with absence of notification to the user regarding the limitation or how it is handled, presents a serious dysfunctionality. For example, if the 37

user switches to "Hex" mode, and then types "10", and then presses the "x^y" button, and then types "10" again, and then presses "=" the result will be "0". That mode selection and keystroke sequence means Calculator is being told to evaluate 16 (decimal) raised to the 16th (decimal) power, and to display the result in hexadecimal base. In "Hex" mode, on a less limited calculator, "10" "x^y" "10" "=", would produce 10000000000000000, which is the hexadecimal representation of X'10' ** X'10'. That number is 17 digits long, and in "Hex" mode, Calculator is limited to registering and displaying no more than 16 hexadecimal digits. In "Hex" mode, if a result is larger than can be represented in 16 hexadecimal digits, Calculator will return a 0. A better calculator program would either produce a correct result or (at least) return an error message. No matter what integer base one may be using, in that base, "10" is the number of the base. Taking to its own power the number of any integer base results in a number which is in that base a 1 followed by a number of 0s equal to the number of the base. So regardless of what integer base one is using, if one keys "10" "x^y" "10" "=", one should get a 1 followed by a number of 0s that is equal to the number of the base one is using. That works fine in Calculator for binary, octal, and decimal modes. Using "Bin" (binary) the user gets 100 (a 1 followed by 2 0s, i.e. base 2). Using "Oct" (octal) the user gets 100000000 (a 1 followed by 8 0s, i.e. base 8). Using "Dec" (decimal) the user gets 10000000000 (a 1 followed by 10 0s, i.e. base 10). But if the user tries to do that using "Hex" mode, the user gets a 0. In hexadecimal, a 10 represents the number that in decimal is represented by 16. If the user selects "Dec" mode, and types "16" and then presses the "x^y" button and then types "16" again, and then presses "=" the result will be (decimal) 18446744073709551616, which is correct, as that is the decimal number for "16 raised to the 16th power". Calculator is capable of displaying that number in decimal, but it is incapable of displaying in hexadecimal any number greater than or equal to that number. If the user seeing that number displayed switches to "Hex" mode, "0" will appear on the resultant display, and if the user then switches back to "Dec" mode, "0" will still appear. That is due to the 16 hexadecimal digit limitation imposed in "Hex" mode, and to the method chosen for handling numbers which cannot be represented in 16 hexadecimal digits. The choice was made to simply substitute zero for any number

38

greater than X'FFFFFFFFFFFFFFFF'. In "Dec" mode, Calculator is limited to 32 digits in result displays. If a user operating Calculator in "Dec" mode produces a result that exceeds the decimal number resultant display limitations of Calculator, Calculator will resort to Scientific Notation, i.e. it will express the number as a between-1-and-10 number (sometimes inclusive of a decimal point and of numerals after the decimal point) times ten to some power. So, for example, Calculator in "Dec" mode, can display Avogadro's Number as 602214179000000000000000 (that value is plus or minus about 30 in the least significant nonzero digits) which is a 24 digit number, but if the user squares that, the result is 3.62661917388644041e+47. That would be a 48 digit number if it were displayed without the e+ notation. Calculator won't do anything analogous to the e+ notation in "Hex" mode. It just reports any number larger than 16 bytes as 0.

Windows 7
The Windows 7 Calculator overcomes many of the limitations described above, however the ability to paste long calculations from a text file with one operation per line is now broken.

Programmer Mode in Windows 7

Scientific mode in Windows 7 Calculator Plus It is a separate application for Windows XP and Windows Server 2003 users that adds a 'Conversion' mode over the Windows XP version of the Calculator. The 'Conversion' mode supports unit conversion and currency conversion. Currency exchange rates can be updated using the built-in update feature, which downloads

39

exchange rates from the European Central Bank.

MAIN WINDOW

40

RESERVATION FORM:

CHECK IN FORM

41

EDIT GUEST INFORMATION

42

GUEST ACCOMODATION PAYMENT

CHECK OUT FORM


43

ADD EMPLOYEE FORM

44

EDIT EMPLOYEE FORM

45

DELETE EMPLOYEE FORM

46

STAFF PAYROLL

47

SEARCHING THE GUESTS

48

SEARCHING THE EMPLOYEES

CODING:
Reservation Form
' ' ' ' ' ' ' ' -----------------------------------------------This Program has written by Preeti Sharma From St Bedes College H.P. University Shimla March 2011 ------------------------------------------------

Dim str As String Private Sub cboRoomNo_Click() If cboRoomType.ListIndex = -1 Then MsgBox "Select The Room Type" cboRoomType.SetFocus

49

Exit Sub End If End Sub Private Sub cboRoomType_Click() If cboRoomType.List(cboRoomType.ListIndex) = "Single Room" Then cboRoomNo.Clear With RS_SingleRoom .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Double Room" Then cboRoomNo.Clear With RS_DoubleRoom .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Suite Room" Then cboRoomNo.Clear With RS_SuiteRoom .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Deluxe Suite" Then cboRoomNo.Clear With RS_DeluxeSuite .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With End If End Sub Private Sub cmdAdd_Click() If txtname.Text = "" Or txtaddress.Text = "" Or _ txtcity.Text = "" Or txtState.Text = "" Or _ txtCountry.Text = "" Or txtcompany.Text = "" Or _ txtdesignation.Text = "" Or txttelephone.Text = "" Or _ txtadvance.Text = "" Then MsgBox "Fill The Complete Information" txtname.SetFocus Exit Sub ElseIf cboRoomType.ListIndex = -1 Then MsgBox "Select Room Type" cboRoomType.SetFocus

50

Exit Sub ElseIf cboRoomNo.ListIndex = -1 Then MsgBox "Select Room No." cboRoomNo.SetFocus Exit Sub End If With RS_Payment .AddNew .Fields(0) = lblGID.Caption .Fields(1) = txtname.Text .Fields(2) = lblDate.Caption .Fields(3) = "Accomodation" .Fields(4) = cboRoomType.List(cboRoomType.ListIndex) .Fields(5) = cboRoomNo.Text .Fields(6) = txtadvance.Text .Fields(7) = 0 .Fields(8) = 0 .Fields(9) = 0 .Fields(10) = Date .Fields(11) = Date .Fields(12) = UserName .Update End With With RS_Paymentlog .AddNew .Fields(0) = lblGID.Caption .Fields(1) = txtname.Text .Fields(2) = lblDate.Caption .Fields(3) = "Accomodation" .Fields(4) = cboRoomType.List(cboRoomType.ListIndex) .Fields(5) = cboRoomNo.Text .Fields(6) = txtadvance.Text .Fields(7) = 0 .Fields(8) = 0 .Fields(9) = 0 .Fields(10) = Date .Fields(11) = UserName .Update End With With RS_Guest .AddNew .Fields(0) = lblDate.Caption .Fields(1) = lblGID.Caption .Fields(2) = txtname.Text .Fields(3) = txtaddress.Text .Fields(4) = txtcity.Text .Fields(5) = txtState.Text .Fields(6) = txtCountry.Text .Fields(7) = lbltime.Caption .Fields(8) = txtcompany.Text .Fields(9) = txtdesignation.Text .Fields(10) = txttelephone.Text .Fields(11) = cboRoomType.List(cboRoomType.ListIndex) .Fields(12) = cboRoomNo.List(cboRoomNo.ListIndex) .Fields(13) = txtadvance.Text If cboRoomType.List(cboRoomType.ListIndex) = "Single Room" Then

51

RS_SingleRoom.MoveFirst Smart_SingleRoom: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_SingleRoom.Fields(0) Then RS_SingleRoom.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_SingleRoom.MoveNext GoTo Smart_SingleRoom End If ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Double Room" Then RS_DoubleRoom.MoveFirst Smart_DoubleRoom: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_DoubleRoom.Fields(0) Then RS_DoubleRoom.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_DoubleRoom.MoveNext GoTo Smart_DoubleRoom End If ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Suite Room" Then RS_SuiteRoom.MoveFirst Smart_SuiteRoom: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_SuiteRoom.Fields(0) Then RS_SuiteRoom.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_SuiteRoom.MoveNext GoTo Smart_SuiteRoom End If ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Deluxe Suite" Then RS_DeluxeSuite.MoveFirst Smart_DeluxeSuite: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_DeluxeSuite.Fields(0) Then RS_DeluxeSuite.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_DeluxeSuite.MoveNext GoTo Smart_DeluxeSuite End If End If .Update txtname.SetFocus num = 100 + .RecordCount + 1 lblGID.Caption = "GUID" + CStr(strMonth) _ + "-" + CStr(num) + "-" + CStr(strYear) End With MsgBox "Record Entered Successfully" Blank With RS_Userlog .AddNew .Fields(0) = UserName

52

.Fields(1) = "Add Guest Record(Reservation)" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With End Sub Private Sub cmdCancel_Click() Unload Me End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 num = 100 strMonth = Month(Date) strYear = Year(Date) str = "ReID" lblDate.Caption = Date lbltime.Caption = Time cboRoomType.AddItem "Single Room" cboRoomType.AddItem "Double Room" cboRoomType.AddItem "Suite Room" cboRoomType.AddItem "Deluxe Suite" Call Connect With RS_Guest If .RecordCount = 0 Then lblGID.Caption = lblGID.Caption + CStr(strMonth) _ + "-" + CStr(num) + "-" + CStr(strYear) Else num = num + .RecordCount + 1 lblGID.Caption = str + CStr(strMonth) _ + "-" + CStr(num) + "-" + CStr(strYear) End If End With End Sub Public Sub Blank() txtname.Text = "" txtaddress.Text = "" txtcity.Text = "" txtState.Text = "" txtCountry.Text = "" txtcompany.Text = "" txtdesignation.Text = "" txttelephone.Text = "" cboRoomType.ListIndex = -1 cboRoomNo.ListIndex = -1 txtadvance.Text = "" End Sub

53

BAR SETTING FORM


Private Sub Combo1_Click() With RS_DrinkPrice .MoveFirst While Not .EOF If Combo1.Text = .Fields(0) Then Label5.Caption = .Fields(2) End If .MoveNext Wend End With End Sub Private Sub Combo2_Click() With RS_DrinkPrice .MoveFirst While Not .EOF If Combo2.Text = .Fields(0) Then Label6.Caption = .Fields(2) End If .MoveNext Wend End With End Sub Private Sub Combo3_Click() With RS_DrinkPrice .MoveFirst While Not .EOF If Combo3.Text = .Fields(0) Then Label7.Caption = .Fields(2) End If .MoveNext Wend End With End Sub Private Sub Combo4_Click() With RS_DrinkPrice .MoveFirst While Not .EOF If Combo4.Text = .Fields(0) Then Label8.Caption = .Fields(2) End If .MoveNext Wend End With End Sub Private Sub Command1_Click() If Option1.Enabled = True And Text1.Text <> "" Then With RS_DrinkPrice .MoveFirst While Not .EOF If Combo1.Text = .Fields(0) Then MsgBox "Record Already Exits", vbOKOnly Exit Sub End If .MoveNext Wend

54

.AddNew .Fields(0) = Combo1.Text .Fields(1) = Option1.Caption .Fields(2) = Text1.Text .Update MsgBox "Record Updated" End With ElseIf Option2.Enabled = True And Text2.Text <> "" Then With RS_DrinkPrice .MoveFirst While Not .EOF If Combo2.Text = .Fields(0) Then MsgBox "Record Already Exits", vbOKOnly Exit Sub End If .MoveNext Wend .AddNew .Fields(0) = Combo2.Text .Fields(1) = Option2.Caption .Fields(2) = Text2.Text .Update MsgBox "Record Updated" End With ElseIf Option3.Enabled = True And Text3.Text <> "" Then With RS_DrinkPrice .MoveFirst While Not .EOF If Combo3.Text = .Fields(0) Then MsgBox "Record Already Exits", vbOKOnly Exit Sub End If MsgBox "Record Updated" .MoveNext Wend .AddNew .Fields(0) = Combo3.Text .Fields(1) = Option3.Caption .Fields(2) = Text3.Text .Update End With ElseIf Option4.Enabled = True And Text4.Text <> "" Then With RS_DrinkPrice .MoveFirst While Not .EOF If Combo4.Text = .Fields(0) Then MsgBox "Record Already Exits", vbOKOnly Exit Sub End If .MoveNext Wend .AddNew .Fields(0) = Combo4.Text .Fields(1) = Option4.Caption .Fields(2) = Text4.Text

55

.Update MsgBox "Record Updated" End With Else: MsgBox "Record is Incomplete", vbCritical, "Error" Exit Sub End If Blank End Sub

Private Sub Command3_Click() Blank Me.Hide End Sub Private Sub Form_Load() Top = 3000 Left = 3000 Label5.Caption = "" Label6.Caption = "" Label7.Caption = "" Label8.Caption = "" Connect With RS_Drink .MoveFirst While Not .EOF If .Fields(1) = "Juice" Then Combo3.AddItem .Fields(0) ElseIf .Fields(1) = "Beer" Then Combo2.AddItem .Fields(0) ElseIf .Fields(1) = "Soft Drinks" Then Combo1.AddItem .Fields(0) End If .MoveNext Wend End With End Sub Sub Blank() Combo1.ListIndex = -1 Combo2.ListIndex = -1 Combo3.ListIndex = -1 Combo4.ListIndex = -1 Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Label5.Caption = "" Label6.Caption = "" Label7.Caption = "" Label8.Caption = "" End Sub

56

LOGIN FORM
Option Explicit 'Variable Declaration Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdOK_Click() If cboUserName.ListIndex = -1 Then MsgBox "Select User Name", vbOKOnly + vbInformation, "Error" Exit Sub End If UserName = cboUserName.List(cboUserName.ListIndex) With RS_Password '.MoveLast .MoveFirst While Not .EOF If UserName = .Fields(1).Value And txtpassword.Text = Decrypt(.Fields(2).Value) Then Rights = .Fields(3).Value MsgBox "Access Granted", vbOKOnly + vbInformation, "Correct" ElseIf UserName = .Fields(1).Value And txtpassword.Text <> Decrypt(.Fields(2).Value) Then MsgBox "Incorrect Password", vbOKOnly + vbInformation, "Correct" Exit Sub frmMDI.Show End If ' Exit Sub .MoveNext Wend End With If Rights = "Administrator" Then frmMDI.StatusBar.Panels(1) = "User Name :- " & UserName ElseIf Rights = "Front Office" Then frmMDI.StatusBar.Panels(1) = "User Name :- " & UserName frmMDI.mnuGuests.Enabled = True frmMDI.mnuEmp.Enabled = False frmMDI.mnuSrchEmp.Enabled = False frmMDI.mnuReportsEmployees.Enabled = False frmMDI.mnuUtiChangeCharges.Enabled = False frmMDI.admin.Enabled = False ElseIf Rights = "Personnel" Then frmMDI.StatusBar.Panels(1) = "User Name :- " & UserName frmMDI.mnuEmp.Enabled = True frmMDI.mnuGuests.Enabled = False frmMDI.mnuSrchGuest.Enabled = False frmMDI.mnuReportsGuests.Enabled = False frmMDI.mnuUtiChangeCharges.Enabled = False frmMDI.admin.Enabled = False End If

57

With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "Log In" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With Load frmSYSTRAYICON Me.Hide frmWelcome.Show 1 End Sub Private Sub Form_Load() Call Connect With RS_Password .MoveLast .MoveFirst While Not .EOF cboUserName.AddItem .Fields(1).Value .MoveNext Wend End With End Sub

ADD USER FORM


Private Sub Command1_Click() If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then MsgBox "Please enter the required records", vbCritical Exit Sub End If If Text3.Text <> Text4.Text Then MsgBox "Password Does not Match" ElseIf Text3.Text = Text4.Text Then With RS_Password .AddNew .Fields(0) = Text1.Text .Fields(1) = Text2.Text .Fields(2) = Crypt(Text3.Text) .Fields(3) = Combo1.Text .Update MsgBox "User Successfully Added" End With End If Blank With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "Added New User" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With

58

End Sub Private Sub Command2_Click() Blank Me.Hide End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Call Connect With RS_Password .MoveFirst While Not .EOF Combo1.AddItem .Fields(3) .MoveNext Wend End With End Sub Sub Blank() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Combo1.ListIndex = -1 End Sub

BAR FORM
Private Sub Combo1_Click() With RS_DrinkPrice .MoveFirst While Not .EOF If Combo1.List(Combo1.ListIndex) = .Fields(0) Then Label4.Caption = .Fields(2) Label6.Caption = .Fields(1) End If .MoveNext Wend End With End Sub Private Sub Combo2_Click() With RS_DrinkPrice .MoveFirst While Not .EOF If Combo1.List(Combo1.ListIndex) = .Fields(0) Then Label9.Caption = .Fields(2) Label11.Caption = .Fields(1) End If .MoveNext Wend End With End Sub Private Sub Combo3_Click() With RS_Guest

59

.MoveFirst While Not .EOF If Combo3.Text = .Fields(1) Then Label15.Caption = .Fields(2) End If .MoveNext Wend End With End Sub Private Sub Command1_Click() Label18.Caption = Label4.Caption * Val(Text1.Text) End Sub Private Sub Command2_Click() Combo1.ListIndex = -1 Text1.Text = "" Label4.Caption = "" Label6.Caption = "" Label18.Caption = "" End Sub Private Sub Command3_Click() Unload Me End Sub Private Sub Command4_Click() Label19.Caption = Label11.Caption * Val(Text2.Text) End Sub Private Sub Command5_Click() Combo2.ListIndex = -1 Combo3.ListIndex = -1 Text2.Text = "" Label9.Caption = "" Label11.Caption = "" Label15.Caption = "" Label19.Caption = "" End Sub Private Sub exi_Click() Me.Hide End Sub Private Sub Form_Load() Top = 3000 Left = 3000 Connect With RS_Drink .MoveFirst While Not .EOF Combo1.AddItem .Fields(0) Combo2.AddItem .Fields(0) .MoveNext Wend End With

60

Label4.Caption = "" Label6.Caption = "" Label9.Caption = "" Label11.Caption = "" Label15.Caption = "" Label19.Caption = "" Label18.Caption = "" With RS_Guest .MoveFirst While Not .EOF Combo3.AddItem .Fields(1) .MoveNext Wend End With Frame1.Enabled = False Frame2.Enabled = False End Sub Private Sub Option1_Click() Frame1.Enabled = True Frame2.Enabled = False End Sub Private Sub Option2_Click() Frame2.Enabled = True Frame1.Enabled = False End Sub Private Sub set_Click() BarSettings.Show 1 End Sub

CHANGE PASSWORD FORM


Option Explicit Dim i As Integer Dim str, UserName, StrSql As String Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdChange_Click() If txtoldpassword.Text = "" Then MsgBox "Enter Complete Information", vbOKOnly + vbInformation, "Information" txtoldpassword.SetFocus Exit Sub End If If txtnewpassword.Text = "" Then MsgBox "Enter Complete Information", vbOKOnly + vbInformation, "Information" txtnewpassword.SetFocus Exit Sub End If If txtconfirmpassword.Text = "" Then MsgBox "Enter Complete Information", vbOKOnly + vbInformation, "Information"

61

txtconfirmpassword.SetFocus Exit Sub End If With RS_Password .MoveLast .MoveFirst While Not .EOF If .Fields(0) = UserName Then If .Fields(1) <> txtoldpassword.Text Then MsgBox "Old Password Doesn't Match", vbOKOnly + vbCritical, "Error" txtoldpassword.SetFocus Exit Sub ElseIf txtnewpassword.Text <> txtconfirmpassword.Text Then MsgBox "New Password Doesn't Match", vbOKOnly + vbCritical, "Error" txtnewpassword.SetFocus Exit Sub Else StrSql = "UPDATE Password_Table SET Pass = '" & txtconfirmpassword.Text & "' " _ & "WHERE UserName = '" & UserName & "';" cnn.Execute StrSql .Update MsgBox "Done" Exit Sub End If End If .MoveNext Wend MsgBox "Password Successfully Changed", vbInformation txtoldpassword.Text = "" txtnewpassword.Text = "" txtconfirmpassword.Text = "" End With With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "User Changed Password" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Call Connect str = frmMDI.StatusBar.Panels(1).Text UserName = Mid(str, 14, Len(str)) lbltitle.Caption = "User Name ----> " & UserName

62

End Sub

CHANGE RATE FORM


Option Explicit Dim StrSql As String Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdChange_Click() With Rs_Rate .MoveFirst If opnSingleRoom.Value = True Then StrSql = "UPDATE Rate_Table SET SingleRoom = '" _ & txtChangeRate.Text & "'" cnn.Execute StrSql .Update lblPresentRate.Caption = txtChangeRate.Text End If If opnDoubleRoom.Value = True Then StrSql = "UPDATE Rate_Table SET DoubleRoom = '" _ & txtChangeRate.Text & "'" cnn.Execute StrSql .Update lblPresentRate.Caption = txtChangeRate.Text End If If opnSuiteRoom.Value = True Then StrSql = "UPDATE Rate_Table SET SuiteRoom = '" _ & txtChangeRate.Text & "'" cnn.Execute StrSql .Update lblPresentRate.Caption = txtChangeRate.Text End If If opnDeluxeSuite.Value = True Then StrSql = "UPDATE Rate_Table SET DeluxeSuite = '" _ & txtChangeRate.Text & "'" cnn.Execute StrSql .Update lblPresentRate.Caption = txtChangeRate.Text End If End With MsgBox "Rate is changed Successfully" With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "Change Hotel Rate" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With End Sub

63

Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Call Connect lblPresentRate.Visible = False cmdChange.Enabled = False End Sub Private Sub opnDeluxeSuite_Click() If opnDeluxeSuite.Value = True Then Rs_Rate.Requery txtChangeRate.Text = "" lblPresentRate.Visible = True lblPresentRate.Caption = Rs_Rate.Fields(3) txtChangeRate.Locked = False End If End Sub Private Sub opnDoubleRoom_Click() If opnDoubleRoom.Value = True Then Rs_Rate.Requery txtChangeRate.Text = "" lblPresentRate.Visible = True lblPresentRate.Caption = Rs_Rate.Fields(1) txtChangeRate.Locked = False End If End Sub Private Sub opnSingleRoom_Click() If opnSingleRoom.Value = True Then Rs_Rate.Requery txtChangeRate.Text = "" lblPresentRate.Visible = True lblPresentRate.Caption = Rs_Rate.Fields(0) txtChangeRate.Locked = False End If End Sub Private Sub opnSuiteRoom_Click() If opnSuiteRoom.Value = True Then Rs_Rate.Requery txtChangeRate.Text = "" lblPresentRate.Visible = True lblPresentRate.Caption = Rs_Rate.Fields(2) txtChangeRate.Locked = False End If End Sub Private Sub txtChangeRate_Change() cmdChange.Enabled = True End Sub Private Sub txtChangeRate_KeyPress(KeyAscii As Integer) If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or _ KeyAscii = vbKeyBack Then Exit Sub

64

Else KeyAscii = 0 End If End Sub

CHARGES FORM
Option Explicit Dim StrSql As String Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdChange_Click() With Rs_Rate .MoveFirst If opnSingleRoom.Value = True Then StrSql = "UPDATE Rate_Table SET SingleRoom = '" _ & txtChangeRate.Text & "'" cnn.Execute StrSql .Update lblPresentRate.Caption = txtChangeRate.Text End If If opnDoubleRoom.Value = True Then StrSql = "UPDATE Rate_Table SET DoubleRoom = '" _ & txtChangeRate.Text & "'" cnn.Execute StrSql .Update lblPresentRate.Caption = txtChangeRate.Text End If If opnSuiteRoom.Value = True Then StrSql = "UPDATE Rate_Table SET SuiteRoom = '" _ & txtChangeRate.Text & "'" cnn.Execute StrSql .Update lblPresentRate.Caption = txtChangeRate.Text End If If opnDeluxeSuite.Value = True Then StrSql = "UPDATE Rate_Table SET DeluxeSuite = '" _ & txtChangeRate.Text & "'" cnn.Execute StrSql .Update lblPresentRate.Caption = txtChangeRate.Text End If End With MsgBox "Rate is changed Successfully" With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "Change Hotel Rate" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful"

65

.Update End With End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Call Connect lblPresentRate.Visible = False cmdChange.Enabled = False End Sub Private Sub opnDeluxeSuite_Click() If opnDeluxeSuite.Value = True Then Rs_Rate.Requery txtChangeRate.Text = "" lblPresentRate.Visible = True lblPresentRate.Caption = Rs_Rate.Fields(3) txtChangeRate.Locked = False End If End Sub Private Sub opnDoubleRoom_Click() If opnDoubleRoom.Value = True Then Rs_Rate.Requery txtChangeRate.Text = "" lblPresentRate.Visible = True lblPresentRate.Caption = Rs_Rate.Fields(1) txtChangeRate.Locked = False End If End Sub Private Sub opnSingleRoom_Click() If opnSingleRoom.Value = True Then Rs_Rate.Requery txtChangeRate.Text = "" lblPresentRate.Visible = True lblPresentRate.Caption = Rs_Rate.Fields(0) txtChangeRate.Locked = False End If End Sub Private Sub opnSuiteRoom_Click() If opnSuiteRoom.Value = True Then Rs_Rate.Requery txtChangeRate.Text = "" lblPresentRate.Visible = True lblPresentRate.Caption = Rs_Rate.Fields(2) txtChangeRate.Locked = False End If End Sub Private Sub txtChangeRate_Change() cmdChange.Enabled = True End Sub

66

Private Sub txtChangeRate_KeyPress(KeyAscii As Integer) If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or _ KeyAscii = vbKeyBack Then Exit Sub Else KeyAscii = 0 End If End Sub

CHECK IN FORM
Option Explicit Dim i As Integer Dim num As Integer Dim strMonth, strYear, result, str As String Public Sub Blank() txtname.Text = "" txtaddress.Text = "" txtcity.Text = "" txtState.Text = "" txtCountry.Text = "" txtcompany.Text = "" txtdesignation.Text = "" txttelephone.Text = "" cboRoomType.ListIndex = -1 cboRoomNo.ListIndex = -1 txtadvance.Text = "" End Sub Private Sub cboRoomNo_Click() If cboRoomType.ListIndex = -1 Then MsgBox "Select The Room Type" cboRoomType.SetFocus Exit Sub End If End Sub Private Sub cboRoomType_Click() If cboRoomType.List(cboRoomType.ListIndex) = "Single Room" Then cboRoomNo.Clear With RS_SingleRoom .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Double Room" Then cboRoomNo.Clear With RS_DoubleRoom .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next

67

End With ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Suite Room" Then cboRoomNo.Clear With RS_SuiteRoom .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Deluxe Suite" Then cboRoomNo.Clear With RS_DeluxeSuite .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With End If End Sub Private Sub cmdAdd_Click() If txtname.Text = "" Or txtaddress.Text = "" Or _ txtcity.Text = "" Or txtState.Text = "" Or _ txtCountry.Text = "" Or txtcompany.Text = "" Or _ txtdesignation.Text = "" Or txttelephone.Text = "" Or _ txtadvance.Text = "" Then MsgBox "Fill The Complete Information" txtname.SetFocus Exit Sub ElseIf cboRoomType.ListIndex = -1 Then MsgBox "Select Room Type" cboRoomType.SetFocus Exit Sub ElseIf cboRoomNo.ListIndex = -1 Then MsgBox "Select Room No." cboRoomNo.SetFocus Exit Sub End If With RS_Payment .AddNew .Fields(0) = lblGID.Caption .Fields(1) = txtname.Text .Fields(2) = lblDate.Caption .Fields(3) = "Accomodation" .Fields(4) = cboRoomType.List(cboRoomType.ListIndex) .Fields(5) = cboRoomNo.Text .Fields(6) = txtadvance.Text .Fields(7) = 0 .Fields(8) = 0 .Fields(9) = 0 .Fields(10) = Date .Fields(11) = Date .Fields(12) = UserName .Update

68

End With With RS_Paymentlog .AddNew .Fields(0) = lblGID.Caption .Fields(1) = txtname.Text .Fields(2) = lblDate.Caption .Fields(3) = "Accomodation" .Fields(4) = cboRoomType.List(cboRoomType.ListIndex) .Fields(5) = cboRoomNo.Text .Fields(6) = txtadvance.Text .Fields(7) = 0 .Fields(8) = 0 .Fields(9) = 0 .Fields(10) = Date .Fields(11) = UserName .Update End With With RS_Guest .AddNew .Fields(0) = lblDate.Caption .Fields(1) = lblGID.Caption .Fields(2) = txtname.Text .Fields(3) = txtaddress.Text .Fields(4) = txtcity.Text .Fields(5) = txtState.Text .Fields(6) = txtCountry.Text .Fields(7) = lbltime.Caption .Fields(8) = txtcompany.Text .Fields(9) = txtdesignation.Text .Fields(10) = txttelephone.Text .Fields(11) = cboRoomType.List(cboRoomType.ListIndex) .Fields(12) = cboRoomNo.List(cboRoomNo.ListIndex) .Fields(13) = txtadvance.Text If cboRoomType.List(cboRoomType.ListIndex) = "Single Room" Then RS_SingleRoom.MoveFirst Smart_SingleRoom: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_SingleRoom.Fields(0) Then RS_SingleRoom.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_SingleRoom.MoveNext GoTo Smart_SingleRoom End If ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Double Room" Then RS_DoubleRoom.MoveFirst Smart_DoubleRoom: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_DoubleRoom.Fields(0) Then RS_DoubleRoom.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_DoubleRoom.MoveNext GoTo Smart_DoubleRoom End If ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Suite Room" Then RS_SuiteRoom.MoveFirst

69

Smart_SuiteRoom: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_SuiteRoom.Fields(0) Then RS_SuiteRoom.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_SuiteRoom.MoveNext GoTo Smart_SuiteRoom End If ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Deluxe Suite" Then RS_DeluxeSuite.MoveFirst Smart_DeluxeSuite: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_DeluxeSuite.Fields(0) Then RS_DeluxeSuite.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_DeluxeSuite.MoveNext GoTo Smart_DeluxeSuite End If End If .Update txtname.SetFocus num = 100 + .RecordCount + 1 lblGID.Caption = "GUID" + CStr(strMonth) _ + "-" + CStr(num) + "-" + CStr(strYear) End With MsgBox "Record Entered Successfully" Blank With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "Add Guest Record" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With End Sub Private Sub cmdCancel_Click() Unload Me End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 num = 100 strMonth = Month(Date) strYear = Year(Date) str = "GUID" lblDate.Caption = Date

70

lbltime.Caption = Time cboRoomType.AddItem "Single Room" cboRoomType.AddItem "Double Room" cboRoomType.AddItem "Suite Room" cboRoomType.AddItem "Deluxe Suite" Call Connect With RS_Guest If .RecordCount = 0 Then lblGID.Caption = lblGID.Caption + CStr(strMonth) _ + "-" + CStr(num) + "-" + CStr(strYear) Else num = num + .RecordCount + 1 lblGID.Caption = str + CStr(strMonth) _ + "-" + CStr(num) + "-" + CStr(strYear) End If End With End Sub

CHECK OUT FORM


Option Explicit 'Variable Declaration Dim DOA As String Dim result, i As Integer Public Sub Blank() cboGuID.ListIndex = -1 txtname.Text = "" txtaddress.Text = "" txtcity.Text = "" txtState.Text = "" txtCountry.Text = "" txtcompany.Text = "" txtdesignation.Text = "" txttelephone.Text = "" txtRoomType.Text = "" txtRoomNo.Text = "" txtadvance.Text = "" txtDOChkin.Text = "" txtTOChkIn.Text = "" txtBalance.Text = "" txtTotalBill.Text = "" End Sub Private Sub cboGuID_Click() cmdDelete.Enabled = True With RS_GuestIn .MoveFirst While Not .EOF If cboGuID.List(cboGuID.ListIndex) = .Fields(1) Then txtDOChkin.Text = .Fields(0) txtname.Text = .Fields(2) txtaddress.Text = .Fields(3) txtcity.Text = .Fields(4) txtState.Text = .Fields(5) txtCountry.Text = .Fields(6) txtTOChkIn.Text = .Fields(7)

71

txtcompany.Text = .Fields(8) txtdesignation.Text = .Fields(9) txttelephone.Text = .Fields(10) txtRoomType.Text = .Fields(11) txtRoomNo.Text = .Fields(12) DOA = .Fields(0) result = Date - CDate(DOA) If result = 0 Then result = 1 End If With RS_Payment .MoveFirst While Not .EOF If cboGuID.List(cboGuID.ListIndex) = RS_Payment.Fields(0) Then txtBalance.Text = Val(RS_Payment.Fields(9)) - Val(RS_Payment.Fields(8)) txtTotalBill.Text = RS_Payment.Fields(9) txtadvance.Text = .Fields(8) End If .MoveNext Wend End With ' If txtRoomType.Text = "Single Room" Then ' txtTotalBill.Text = result * Rs_Rate.Fields(0) ' txtBalance.Text = txtTotalBill.Text - txtadvance.Text ' End If ' If txtRoomType.Text = "Double Room" Then ' txtTotalBill.Text = result * Rs_Rate.Fields(1) ' txtBalance.Text = txtTotalBill.Text - txtadvance.Text ' End If ' If txtRoomType.Text = "Suite Room" Then ' txtTotalBill.Text = result * Rs_Rate.Fields(2) ' txtBalance.Text = txtTotalBill.Text - txtadvance.Text ' End If ' If txtRoomType.Text = "Deluxe Suite" Then ' txtTotalBill.Text = result * Rs_Rate.Fields(3) ' txtBalance.Text = txtTotalBill.Text - txtadvance.Text ' End If Exit Sub Else .MoveNext End If Wend End With End Sub Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdDelete_Click() With RS_GuestOut .AddNew .Fields(0) = lblDate.Caption .Fields(1) = lbltime.Caption .Fields(2) = cboGuID.List(cboGuID.ListIndex) .Fields(3) = txtname.Text .Fields(4) = txtaddress.Text

72

.Fields(5) = txtcity.Text .Fields(6) = txtState.Text .Fields(7) = txtCountry .Fields(8) = txtcompany.Text .Fields(9) = txtdesignation.Text .Fields(10) = txttelephone.Text .Fields(11) = txtRoomType.Text .Fields(12) = txtRoomNo.Text .Fields(13) = txtadvance.Text .Fields(14) = txtDOChkin.Text .Fields(15) = txtTOChkIn.Text .Fields(16) = txtBalance.Text .Fields(17) = txtTotalBill.Text .Update End With If txtRoomType.Text = "Single Room" Then RS_SingleRoom.AddNew RS_SingleRoom.Fields(0) = txtRoomNo.Text RS_SingleRoom.Update End If If txtRoomType.Text = "Double Room" Then RS_DoubleRoom.AddNew RS_DoubleRoom.Fields(0) = txtRoomNo.Text RS_DoubleRoom.Update End If If txtRoomType.Text = "Suite Room" Then RS_SuiteRoom.AddNew RS_SuiteRoom.Fields(0) = txtRoomNo.Text RS_SuiteRoom.Update End If If txtRoomType.Text = "Deluxe Suite" Then RS_DeluxeSuite.AddNew RS_DeluxeSuite.Fields(0) = txtRoomNo.Text RS_DeluxeSuite.Update End If With RS_GuestIn .MoveFirst smart: If cboGuID.List(cboGuID.ListIndex) = _ .Fields(1) Then .Delete cboGuID.RemoveItem cboGuID.ListIndex Else .MoveNext GoTo smart End If MsgBox "Record Is Successfully Checked Out" cmdDelete.Enabled = False cboGuID.SetFocus End With With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "Check Out" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful"

73

.Update End With Blank End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 lblDate.Caption = Date lbltime.Caption = Time cmdDelete.Enabled = False Call Connect With RS_GuestIn While Not .EOF cboGuID.AddItem .Fields(1) .MoveNext Wend End With End Sub

HOTEL INFORMATION FORM


Private Sub Command1_Click() With RS_Company .Update Text1.Text = .Fields(0) Text2.Text = .Fields(1) Text3.Text = .Fields(2) Text4.Text = .Fields(3) Text5.Text = .Fields(4) .Fields(6) = Date MsgBox "Record Successfully updated", vbOKOnly + vbInformation, "Update Records" 'End If End With End Sub Private Sub Command2_Click() Form_Activate Me.Hide End Sub Private Sub Form_Activate() Call Connect End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Connect With RS_Company Text1.Text = .Fields(0) Text2.Text = .Fields(1) Text3.Text = .Fields(2) Text4.Text = .Fields(3) Text5.Text = .Fields(4) End With End Sub

74

DELETE EMPLOYEE FORM


Option Explicit 'Variable Declaration Dim i, J As Integer Public Sub LCK() txtemployeename.Locked = True txtaddress.Locked = True txtcity.Locked = True txtState.Locked = True txtpin.Locked = True txtphone.Locked = True txteduqualification.Locked = True txtdesignation.Locked = True txtDepartment.Locked = True txtExp.Locked = True txtDOJ.Locked = True End Sub Private Sub cboID_Click() With RS_Delete .MoveLast .MoveFirst While .EOF = False If cboID.List(cboID.ListIndex) = .Fields(0) Then txtemployeename.Text = .Fields(1) txtaddress.Text = .Fields(2) txtcity.Text = .Fields(3) txtState.Text = .Fields(4) txtpin.Text = .Fields(5) txtphone.Text = .Fields(6) txtDOJ.Text = .Fields(7) txteduqualification.Text = .Fields(8) txtdesignation.Text = .Fields(9) txtDepartment.Text = .Fields(10) txtExp.Text = .Fields(11) .MoveNext Else .MoveNext End If Wend End With cmdDelete.Enabled = True End Sub Private Sub cmdCancel_Click() Unload Me Me.Visible = False End Sub Private Sub cmdDelete_Click() With RS_Enter .AddNew .Fields(0) = cboID.List(cboID.ListIndex) .Fields(1) = txtemployeename.Text .Fields(2) = txtaddress.Text .Fields(3) = txtcity.Text

75

.Fields(4) = txtState.Text .Fields(5) = txtpin.Text .Fields(6) = txtphone.Text .Fields(7) = txteduqualification.Text .Fields(8) = txtdesignation.Text .Fields(9) = txtDepartment.Text .Fields(10) = txtExp.Text .Fields(11) = txtDOJ.Text .Fields(12) = lblDate.Caption .Update End With txtemployeename.Text = "" txtaddress.Text = "" txtcity.Text = "" txtState.Text = "" txtpin.Text = "" txtphone.Text = "" txteduqualification.Text = "" txtdesignation.Text = "" txtDepartment.Text = "" txtExp.Text = "" txtDOJ.Text = "" With RS_Delete .MoveLast .MoveFirst While Not .EOF If cboID.List(cboID.ListIndex) = .Fields(0) Then .Delete cboID.RemoveItem cboID.ListIndex MsgBox "Record Is Deleted" cmdDelete.Enabled = False cboID.SetFocus Exit Sub Else .MoveNext End If Wend End With End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 lblDate.Caption = Date Call Connect cmdDelete.Enabled = False LCK With RS_Delete If .RecordCount = 0 Then MsgBox "There are no records" ' Unload Me Exit Sub

76

Else .MoveLast i = .RecordCount .MoveFirst For J = 1 To i cboID.AddItem .Fields(0) .MoveNext Next End If End With End Sub

EDIT EMPLOYEE FORM


Option Explicit 'Variable Declaration Dim i, J As Integer Public Sub LCK() txtemployeename.Locked = True txtaddress.Locked = True txtcity.Locked = True txtState.Locked = True txtpin.Locked = True txtphone.Locked = True txteduqualification.Locked = True txtdesignation.Locked = True txtDepartment.Locked = True txtExp.Locked = True txtDOJ.Locked = True End Sub Private Sub cboID_Click() If cboID.ListIndex = -1 Then cmdEdit.Enabled = False Exit Sub End If With rs .MoveLast .MoveFirst .Requery While .EOF = False If cboID.List(cboID.ListIndex) = .Fields(0) Then txtemployeename.Text = .Fields(1) txtaddress.Text = .Fields(2) txtcity.Text = .Fields(3) txtState.Text = .Fields(4) txtpin.Text = .Fields(5) txtphone.Text = .Fields(6) txtDOJ.Text = .Fields(7) txteduqualification.Text = .Fields(8) txtdesignation.Text = .Fields(9) txtDepartment.Text = .Fields(10) txtExp.Text = .Fields(11) .MoveNext Else .MoveNext End If Wend End With

77

cmdEdit.Enabled = True End Sub Private Sub cmdCancel_Click() Unload Me Me.Visible = False End Sub Private Sub cmdEdit_Click() cmdEdit.Enabled = False cmdSave.Enabled = True txtemployeename.Locked = False txtaddress.Locked = False txtcity.Locked = False txtState.Locked = False txtpin.Locked = False txtphone.Locked = False txteduqualification.Locked = False txtdesignation.Locked = False txtDepartment.Locked = False txtExp.Locked = False txtDOJ.Locked = False End Sub Private Sub cmdsave_click() Dim StrSql As String txtemployeename.SetFocus With rs .MoveLast .MoveFirst While .EOF = False If cboID.List(cboID.ListIndex) = .Fields(0) Then StrSql = "UPDATE PresentEmp_Table SET Name = '" & txtemployeename.Text & "'," _ & "Address = '" & txtaddress.Text & "'," _ & "City = '" & txtcity.Text & "'," _ & "State = '" & txtState.Text & "'," _ & "Pin = '" & txtpin.Text & "'," _ & "Phone = '" & txtphone.Text & "'," _ & "DOJ = '" & txtDOJ.Text & "'," _ & "Education = '" & txteduqualification.Text & "'," _ & "Designation = '" & txtdesignation.Text & "'," _ & "Department = '" & txtDepartment.Text & "'," _ & "Exp = '" & txtExp.Text & "' " _ & "WHERE EmpID = '" & cboID.List(cboID.ListIndex) & "';" cnn.Execute StrSql .Update MsgBox "Record Is updated" .MoveNext Else .MoveNext End If Wend End With cmdSave.Enabled = False cmdEdit.Enabled = True LCK txtemployeename.Text = ""

78

txtaddress.Text = "" txtcity.Text = "" txtState.Text = "" txtpin.Text = "" txtphone.Text = "" txteduqualification.Text = "" txtdesignation.Text = "" txtDepartment.Text = "" txtExp.Text = "" txtDOJ.Text = "" cboID.ListIndex = -1 cboID.SetFocus End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 lblDate.Caption = Date Call Connect cmdSave.Enabled = False cmdEdit.Enabled = False LCK With rs If .RecordCount = 0 Then MsgBox "There are no records" ' Unload Me Exit Sub Else .MoveLast i = .RecordCount .MoveFirst For J = 1 To i cboID.AddItem .Fields(0) .MoveNext Next End If End With End Sub

EDIT GUEST INFORMATION FORM


Option Explicit 'Variable Declaration Dim StrSql As String Dim i As Integer Public Sub RoomAdd2() If txtRoomType.Text = "Single Room" Then RS_SingleRoom.AddNew RS_SingleRoom.Fields(0) = txtRoomNo.Text RS_SingleRoom.Update End If If txtRoomType.Text = "Double Room" Then

79

RS_DoubleRoom.AddNew RS_DoubleRoom.Fields(0) = txtRoomNo.Text RS_DoubleRoom.Update End If If txtRoomType.Text = "Suite Room" Then RS_SuiteRoom.AddNew RS_SuiteRoom.Fields(0) = txtRoomNo.Text RS_SuiteRoom.Update End If If txtRoomType.Text = "Deluxe Suite" Then RS_DeluxeSuite.AddNew RS_DeluxeSuite.Fields(0) = txtRoomNo.Text RS_DeluxeSuite.Update End If End Sub Public Sub RoomAdd1() If cboRoomType.List(cboRoomType.ListIndex) = "Single Room" Then RS_SingleRoom.MoveFirst Smart_SingleRoom: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_SingleRoom.Fields(0) Then RS_SingleRoom.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_SingleRoom.MoveNext GoTo Smart_SingleRoom End If ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Double Room" Then RS_DoubleRoom.MoveFirst Smart_DoubleRoom: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_DoubleRoom.Fields(0) Then RS_DoubleRoom.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_DoubleRoom.MoveNext GoTo Smart_DoubleRoom End If ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Suite Room" Then RS_SuiteRoom.MoveFirst Smart_SuiteRoom: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_SuiteRoom.Fields(0) Then RS_SuiteRoom.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_SuiteRoom.MoveNext GoTo Smart_SuiteRoom End If ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Deluxe Suite" Then RS_DeluxeSuite.MoveFirst Smart_DeluxeSuite: If cboRoomNo.List(cboRoomNo.ListIndex) = RS_DeluxeSuite.Fields(0) Then RS_DeluxeSuite.Delete cboRoomNo.RemoveItem cboRoomNo.ListIndex Else RS_DeluxeSuite.MoveNext GoTo Smart_DeluxeSuite

80

End If End If '.Update End Sub Public Sub LCK() txtname.Locked = False txtaddress.Locked = False txtcity.Locked = False txtState.Locked = False txtCountry.Locked = False txtcompany.Locked = False txtdesignation.Locked = False txttelephone.Locked = False 'txtRoomType.Locked = False 'txtRoomNo.Locked = False txtadvance.Locked = False txtDOChkin.Locked = False txtTOChkIn.Locked = False End Sub Public Sub Blank() cboGuID.ListIndex = -1 txtname.Text = "" txtaddress.Text = "" txtcity.Text = "" txtState.Text = "" txtCountry.Text = "" txtcompany.Text = "" txtdesignation.Text = "" txttelephone.Text = "" txtRoomType.Text = "" txtRoomNo.Text = "" txtadvance.Text = "" txtDOChkin.Text = "" txtTOChkIn.Text = "" End Sub Private Sub cboGuID_Click() If cboGuID.ListIndex = -1 Then cmdEdit.Enabled = False Exit Sub End If cmdEdit.Enabled = True With RS_Edit .MoveFirst While Not .EOF If cboGuID.List(cboGuID.ListIndex) = .Fields(1) Then txtDOChkin.Text = .Fields(0) txtname.Text = .Fields(2) txtaddress.Text = .Fields(3) txtcity.Text = .Fields(4) txtState.Text = .Fields(5) txtCountry.Text = .Fields(6) txtTOChkIn.Text = .Fields(7) txtcompany.Text = .Fields(8)

81

txtdesignation.Text = .Fields(9) txttelephone.Text = .Fields(10) txtRoomType.Text = .Fields(11) txtRoomNo.Text = .Fields(12) txtadvance.Text = .Fields(13) End If .MoveNext Wend End With End Sub Private Sub cboRoomType_Click() If cboRoomType.ListIndex = 0 Then cboRoomNo.Clear Label3.Visible = False cboRoomNo.Visible = False Exit Sub End If If cboRoomType.List(cboRoomType.ListIndex) = "Single Room" Then cboRoomNo.Clear With RS_SingleRoom .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Double Room" Then cboRoomNo.Clear With RS_DoubleRoom .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Suite Room" Then cboRoomNo.Clear With RS_SuiteRoom .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With ElseIf cboRoomType.List(cboRoomType.ListIndex) = "Deluxe Suite" Then cboRoomNo.Clear With RS_DeluxeSuite .MoveFirst i=0 For i = 1 To .RecordCount cboRoomNo.AddItem .Fields(0) .MoveNext Next End With End If

82

Label3.Visible = True cboRoomNo.Visible = True End Sub Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdEdit_Click() cmdUpdate.Enabled = True cmdEdit.Enabled = False LCK Label1.Visible = True cboRoomType.Visible = True cboRoomType.ListIndex = -1 End Sub Private Sub cmdUpdate_Click() RS_Edit.MoveFirst If cboRoomType.ListIndex >= 1 And cboRoomNo.ListIndex <> -1 Then StrSql = "UPDATE CheckIn_Table SET Name = '" & txtname.Text & "'," _ & "Address = '" & txtaddress.Text & "'," _ & "City = '" & txtcity.Text & "'," _ & "State = '" & txtState.Text & "'," _ & "Country = '" & txtCountry.Text & "'," _ & "TOChk = '" & txtTOChkIn.Text & "'," _ & "Company = '" & txtcompany.Text & "'," _ & "Designation = '" & txtdesignation.Text & "'," _ & "Phone = '" & txttelephone.Text & "'," _ & "Advance = '" & txtadvance.Text & "', " _ & "DOChk = '" & txtDOChkin.Text & "', " _ & "RoomType = '" & cboRoomType.List(cboRoomType.ListIndex) & "', " _ & "RoomNo = '" & cboRoomNo.List(cboRoomNo.ListIndex) & "' " _ & "WHERE GuID = '" & cboGuID.List(cboGuID.ListIndex) & "';" cnn.Execute StrSql RS_Edit.Update RoomAdd1 RoomAdd2 MsgBox "Record is Updated" ElseIf cboRoomType.ListIndex <= 0 Then StrSql = "UPDATE CheckIn_Table SET Name = '" & txtname.Text & "'," _ & "Address = '" & txtaddress.Text & "'," _ & "City = '" & txtcity.Text & "'," _ & "State = '" & txtState.Text & "'," _ & "Country = '" & txtCountry.Text & "'," _ & "TOChk = '" & txtTOChkIn.Text & "'," _ & "Company = '" & txtcompany.Text & "'," _ & "Designation = '" & txtdesignation.Text & "'," _ & "Phone = '" & txttelephone.Text & "'," _ & "Advance = '" & txtadvance.Text & "', " _ & "DOChk = '" & txtDOChkin.Text & "', " _ & "RoomType = '" & txtRoomType.Text & "', " _ & "RoomNo = '" & txtRoomNo.Text & "' " _ & "WHERE GuID = '" & cboGuID.List(cboGuID.ListIndex) & "';" cnn.Execute StrSql RS_Edit.Update MsgBox "Record is Updated"

83

ElseIf cboRoomType.ListIndex >= 1 And cboRoomNo.ListIndex = -1 Then MsgBox "Select Room Type & Room No", vbOKOnly + vbInformation, "Information" cboRoomType.SetFocus Exit Sub End If cmdUpdate.Enabled = False Blank Label1.Visible = False cboRoomType.Visible = False Label3.Visible = False cboRoomNo.Visible = False cboGuID.ListIndex = -1 cboGuID.SetFocus RS_Edit.Requery End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Connect With RS_Edit While Not .EOF cboGuID.AddItem .Fields(1) .MoveNext Wend End With cmdEdit.Enabled = False cmdUpdate.Enabled = False Label1.Visible = False Label3.Visible = False cboRoomType.Visible = False cboRoomNo.Visible = False cboRoomType.AddItem "None" cboRoomType.AddItem "Single Room" cboRoomType.AddItem "Double Room" cboRoomType.AddItem "Suite Room" cboRoomType.AddItem "Deluxe Suite" End Sub

ADD EMPLOYEE FORM


Option Explicit 'Variable Declaration Dim str As String Dim strMonth, result As String Dim num, i As Integer Public Sub Blank() txtemployeename.Text = "" txtaddress.Text = "" txtcity.Text = "" txtState.Text = "" txtpin.Text = "" txtphone.Text = ""

84

txteduqualification.Text = "" txtdesignation.Text = "" txtExp.Text = "" cboDepartment.ListIndex = -1 End Sub

Private Sub cmdAdd_Click() If txtemployeename.Text = "" Or txtaddress.Text = "" Or _ txtcity.Text = "" Or txtState.Text = "" Or _ txtpin.Text = "" Or txtphone.Text = "" Or _ txteduqualification.Text = "" Or txtExp.Text = "" Then MsgBox "Fill Complete Information", vbInformation, "Information" txtemployeename.SetFocus Exit Sub ElseIf cboDepartment.ListIndex = -1 Then MsgBox "Select the department", vbInformation, "Information" cboDepartment.SetFocus Exit Sub Else With rs .AddNew .Fields(0) = lblID.Caption .Fields(1) = txtemployeename.Text .Fields(2) = txtaddress.Text .Fields(3) = txtcity.Text .Fields(4) = txtState.Text .Fields(5) = txtpin.Text .Fields(6) = txtphone.Text .Fields(7) = lblDate.Caption .Fields(8) = txteduqualification.Text .Fields(9) = txtdesignation.Text .Fields(10) = cboDepartment.List(cboDepartment.ListIndex) .Fields(11) = txtExp.Text .Update MsgBox "Record Entered Successfully" Blank If .RecordCount = 0 Then lblID.Caption = str & strMonth & "-" & num Else .MoveLast i = .RecordCount num = num + i lblID.Caption = str & strMonth & "-" & num End If End With End If

End Sub Private Sub cmdCancel_Click() Unload Me Me.Visible = False End Sub

85

Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 num = 100 str = "EmpID" strMonth = Month(Date) lblDate.Caption = Date cboDepartment.AddItem "Front Office" cboDepartment.AddItem "House Keeping" cboDepartment.AddItem "Food & Beverage" cboDepartment.AddItem "Security" cboDepartment.AddItem "Maintenance" cboDepartment.AddItem "Purchase & Stores" cboDepartment.AddItem "Sales & Marketing" Connect Blank With rs If .RecordCount = 0 Then lblID.Caption = str & strMonth & "-" & num Else .MoveLast i = .RecordCount num = num + i lblID.Caption = str & strMonth & "-" & num End If End With End Sub

GUEST ACCOMODATION FORM


Dim DOA As String Dim result, i As Integer Private Sub Combo1_Click() With RS_Guest .MoveFirst While Not .EOF If Combo1.List(Combo1.ListIndex) = .Fields(1) Then Text1.Text = .Fields(2) Text2.Text = .Fields(13) Text6.Text = .Fields(0) DOA = .Fields(0) result = Date - CDate(DOA) If result = 0 Then result = 1 End If If .Fields(11).Value = "Single Room" Then Text4.Text = result * Rs_Rate.Fields(0) Text5.Text = Text4.Text - Text2.Text End If If .Fields(11).Value = "Double Room" Then Text4.Text = result * Rs_Rate.Fields(1) Text5.Text = Text4.Text - Text2.Text End If

86

If .Fields(11).Value = "Suite Room" Then Text4.Text = result * Rs_Rate.Fields(2) Text5.Text = Text4.Text - Text2.Text End If If .Fields(11).Value = "Deluxe Suite" Then Text4.Text = result * Rs_Rate.Fields(3) Text5.Text = Text4.Text - Text2.Text End If End If .MoveNext Wend End With End Sub Private Sub Command1_Click() With RS_Paymentlog .MoveFirst While Not .EOF If Combo1.Text = .Fields(0) Then .AddNew .Fields(0) = Combo1.Text .Fields(1) = Text1.Text .Fields(2) = Text6.Text .Fields(3) = Combo2.Text .Fields(6) = Text2.Text .Fields(7) = Text3.Text .Fields(8) = Val(Text3.Text) + Val(Text2.Text) .Fields(9) = Text4.Text .Fields(10) = Date .Fields(11) = UserName .Update End If .MoveNext Wend End With With RS_Payment .MoveFirst While Not .EOF If Combo1.Text = .Fields(0) Then .Update .Fields(0) = Combo1.Text .Fields(1) = Text1.Text .Fields(2) = Text6.Text .Fields(6) = Text2.Text .Fields(7) = Text3.Text .Fields(8) = Val(Text3.Text) + Val(Text2.Text) .Fields(9) = Text4.Text .Fields(11) = Date .Fields(12) = UserName End If .MoveNext Wend End With MsgBox "Payment Successfully Updated", vbOKOnly, "Payment" 'Command2_Click End Sub

87

Private Sub Command2_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Combo1.ListIndex = -1 Me.Hide End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Connect With RS_Guest .MoveFirst While Not .EOF Combo1.AddItem .Fields(1) .MoveNext Wend End With Combo2.AddItem "Accomodation" Combo2.AddItem "Bar" Combo2.AddItem "Laundry" Combo2.AddItem "Restaurant" End Sub

MAIN FORM
Dim c As Integer Dim prevHour As Byte Private Sub adduser_Click() frmAddUser.Show 1 End Sub Private Sub allemp_Click() DataReport1.Show End Sub Private Sub backup_Click() frmBackup.Show 1 End Sub Private Sub comp_Click() frmCompany.Show 1 End Sub Private Sub coolgreen_Click() Call select_color_type(3) sys_color = "3" End Sub Private Sub dai_Click() frmReport.Show 1 End Sub

88

Private Sub def_Click() Call select_color_type(0) sys_color = "0" End Sub Private Sub id_Click() rptEmpReport.Show 1 End Sub Private Sub lightbr_Click() Call select_color_type(5) sys_color = "5" End Sub Private Sub liviolet_Click() Call select_color_type(4) sys_color = "4" End Sub Private Sub macgrey_Click() Call select_color_type(1) sys_color = "1" End Sub Private Sub MDIForm_Load() StatusBar.Panels(2).Text = Format(Date, "long date") Connect With RS_Company Label1.Caption = .Fields(0) Label2.Caption = .Fields(1) Label3.Caption = .Fields(2) Label4.Caption = "You are Logged in as : - " & UserName Label5.Caption = Now frmsidebar.Show frmTip.Show End With loadTicker End Sub Private Sub mnuEmpAdd_Click() frmEmployeeAdd.Show 1 End Sub Private Sub mnuEmpDelete_Click() frmDeleteEmployee.Show 1 End Sub Private Sub mnuEmpEdit_Click() frmEditemployee.Show 1 End Sub Private Sub mnuExit_Click() If MsgBox("Are You Sure ?", vbYesNo + vbInformation, "Warning") = vbYes Then End Unload frmSYSTRAYICON

89

End If With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "Log Out" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With End Sub Private Sub mnuGuCheckIn_Click() frmcheckIn.Show 1 End Sub Private Sub mnuGuCheckOut_Click() frmCheckOut.Show 1 End Sub

Private Sub mnuGuEdit_Click() frmEditGuest.Show 1 End Sub Private Sub mnuHelpAbout_Click() Forms (12) End Sub Private Sub mnuLogOff_Click() If MsgBox("Are you sure you want to Log Off?", vbYesNo) = vbYes Then Unload Me Load fmLogin fmLogin.Show Else Exit Sub End If End Sub Private Sub mnuSrchEmp_Click() frmSearchEmp.Show 1 End Sub Private Sub mnuSrchGuest_Click() frmSearchGuest.Show 1 End Sub Private Sub mnuUtiCal_Click() On Error GoTo errHandle Dim a As Double a = Shell("calc.exe", vbNormalFocus) Exit Sub errHandle: MsgBox "Unable to run Calculator Utility on your computer", vbInformation, "Error in opening!!!" Resume Next End Sub

90

Private Sub mnuUtiChangeCharges_Click() frmChangeRate.Show 1 End Sub Private Sub mnuUtiChangePass_Click() frmChangePassword.Show 1 End Sub Private Sub mnuUtiNotepad_Click() On Error GoTo errHandle Dim a As Double a = Shell("notepad.exe", vbNormalFocus) Exit Sub errHandle: MsgBox "Unable to run Notepad Utility on your computer", vbInformation, "Error in opening!!!" Resume Next End Sub Private Sub mnuViewCharges_Click() frmCharges.Show 1 End Sub Private Sub mnuViewStatus_Click() frmStatus.Show 1 End Sub Private Sub pay_Click() frmPayroll.Show 1 End Sub Private Sub payment_Click() frmGuestPayment.Show 1 End Sub Private Sub res_Click() frmreservations.Show 1 End Sub Private Sub sb_Click() If frmsidebar.Visible = True Then frmsidebar.Visible = False ElseIf frmsidebar.Visible = False Then frmsidebar.Visible = True End If End Sub Private Sub Timer1_Timer() StatusBar.Panels(4).Text = Right(StatusBar.Panels(4).Text, Len(StatusBar.Panels(4).Text) - 1) & Left(StatusBar.Panels(4).Text, 1) End Sub Private Sub viewus_Click() frmViewUsers.Show 1 End Sub Private Sub winclassic_Click() Call select_color_type(6) sys_color = "6"

91

End Sub Private Sub xpblue_Click() Call select_color_type(2) sys_color = "2" End Sub Private Sub loadTicker() Dim tickSQL As String tickSQL = " SELECT msgTitle,msgText FROM Ticker " 'Dim rs_ticker As Recordset 'RS_ticker.Open tickSQL, cnn, adOpenDynamic, adLockPessimistic 'First load an array of labels Dim i As Integer 'Assign recordset to labels i=0 While Not RS_ticker.EOF On Error Resume Next lblTicker(i).Container = frmTick lblTicker(i).Visible = False lblTicker(i).Caption = RS_ticker("msgTitle") & vbCrLf & RS_ticker("msgText") i=i+1 Load lblTicker RS_ticker.MoveNext Wend 'RS_ticker.Close 'Set RS_ticker = Nothing tmrTicker.Enabled = True c=0 End Sub Private Sub tmrTicker_Timer() Dim currMin As Byte currMin = Minute(Now()) If currMin > prevmin Then 'Refreshes every hour prevmin = currMin destroyTicker loadTicker End If moveTicker 15 End Sub Private Sub moveTicker(ByVal amt As Integer) lblTicker(c).ZOrder vbBringToFront lblTicker(c).Visible = True lblTicker(c).Top = lblTicker(c).Top - amt If lblTicker(c).Top < 0 - lblTicker(c).Height Then 'hide the current lbl lblTicker(c).Visible = False c=c+1 If c > lblTicker.UBound Then c=0 End If tickerStart End If End Sub Private Sub destroyTicker() Dim i As Integer For i = lblTicker.LBound To lblTicker.UBound 'Suppose to free memory

92

If i <> 0 Then Unload lblTicker(i) End If Next i End Sub Private Sub tickerStart() 'Starts the news ticker 'Set the first ticker visible and position on top of frame lblTicker(c).Visible = True 'lblTicker(c).Top = frmTick.Height lblTicker(c).Left = 120 tmrTicker.Enabled = True End Sub Private Sub tickerStop() 'Stops the news ticker tmrTicker.Enabled = False destroyTicker End Sub

PAYROLL FORM
Dim HW, HR, BS, TA, MA, GP As String Dim TAX, PEN, SA, NP As String Private Sub Combo1_Click() With Rs_Details .MoveFirst While Not .EOF If Combo1.List(Combo1.ListIndex) = .Fields(0) Then Label4.Caption = .Fields(1) Label5.Caption = .Fields(10) Label7.Caption = .Fields(9) End If .MoveNext Wend End With Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" Text10.Text = "" End Sub Private Sub Combo2_Click() With RS_Payroll .MoveFirst While Not .EOF If Combo2.List(Combo2.ListIndex) = .Fields(4) Then Text1.Text = .Fields(5) Text2.Text = .Fields(6) Text3.Text = .Fields(7) Text4.Text = .Fields(8) Text5.Text = .Fields(9) Text6.Text = .Fields(10)

93

Text7.Text = .Fields(11) Text8.Text = .Fields(12) Text10.Text = .Fields(13) MsgBox "Record Already Exist for the month" End If .MoveNext Wend End With End Sub Private Sub Command1_Click() BS = Val(Text3.Text) TA = Val(Text4.Text) MA = Val(Text5.Text) TAX = Val(Text7.Text) PEN = Val(Text8.Text) NP = Val(Text10.Text) GP = BS + TA + MA Text6.Text = GP TAX = BS / 100 * 5 Text7.Text = TAX NP = GP - TAX - Val(Text8.Text) Text10.Text = NP End Sub Private Sub Command2_Click() Blank Me.Hide End Sub Private Sub Command3_Click() If Text1.Text = "" Or Text2.Text = "" Or Text4.Text = "" Or Text5.Text = "" Then MsgBox "Pls Input the Required Fields", vbCritical Exit Sub End If With RS_Payroll .MoveFirst While Not .EOF If Combo1.Text = .Fields(0) Then If Combo2.Text = .Fields(4) Then MsgBox "U have already Processed Payment for this Month", vbCritical, "Process Error" Exit Sub End If End If .MoveNext Wend .AddNew .Fields(0) = Combo1.Text .Fields(1) = Label4.Caption .Fields(2) = Label5.Caption .Fields(3) = Label7.Caption .Fields(4) = Combo2.Text .Fields(5) = Text1.Text .Fields(6) = Text2.Text .Fields(7) = Text3.Text .Fields(8) = Text4.Text .Fields(9) = Text5.Text

94

.Fields(10) = Text6.Text .Fields(11) = Text7.Text .Fields(12) = Text8.Text .Fields(13) = Text10.Text .Fields(14) = Date .Fields(15) = UserName .Update MsgBox "Payroll Record Successfully Updated", vbInformation, "Update Record" Blank End With End Sub Private Sub Command5_Click() ResetPay.Show 1 End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Connect With Rs_Details .MoveFirst While Not .EOF Combo1.AddItem .Fields(0) .MoveNext Wend End With Label4.Caption = "" Label5.Caption = "" Label7.Caption = "" Combo2.AddItem "January" Combo2.AddItem "February" Combo2.AddItem "March" Combo2.AddItem "April" Combo2.AddItem "May" Combo2.AddItem "June" Combo2.AddItem "July" Combo2.AddItem "August" Combo2.AddItem "September" Combo2.AddItem "October" Combo2.AddItem "November" Combo2.AddItem "December" End Sub Private Sub Text3_GotFocus() If Text1.Text = "" Or Text2.Text = "" Then MsgBox "Pls Enter values for the required fields for Basic Salary to be calculate", vbOKOnly Exit Sub Else HW = Val(Text1.Text) HR = Val(Text2.Text) BS = Val(HW) * Val(HR) Text3.Text = BS End If End Sub Sub Blank() Text1.Text = "" Text2.Text = "" Text3.Text = ""

95

Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" Text10.Text = "" Combo1.ListIndex = -1 Combo2.ListIndex = -1 Label4.Caption = "" Label5.Caption = "" Label7.Caption = "" End Sub

REPORT FORM
Private Sub Command1_Click() 'fillgrid If Combo1.ListIndex = -1 Then MsgBox "Select a Search Criteria", vbOKOnly + vbCritical, "Error" End If 'Exit Sub If Text1.Text = "" Then MsgBox "Enter Text to Search", vbOKOnly + vbCritical, "Error" Text1.SetFocus Exit Sub End If If Combo1.ListIndex = 0 Then Search_Name ElseIf Combo1.ListIndex = 1 Then Search_Date ElseIf Combo1.ListIndex = 2 Then 'Search_payment End If End Sub Private Sub Command2_Click() Text1.Text = "" Combo1.ListIndex = -1 filllist End Sub Private Sub Command3_Click() Text1.Text = "" Combo1.ListIndex = -1 Me.Hide End Sub Private Sub Command4_Click() If lvReport.ListItems.count >= 1 Then Printer.CurrentY = 200 Printer.CurrentX = 3000 Printer.Print UCase(Company) Printer.CurrentX = 3200 Printer.Print Add Printer.Print "" Printer.CurrentX = 200 Printer.Print "User Name: " & UCase(UserName) & "

96

Date: " & Date Printer.Print "" Printer.Print "" Printer.CurrentX = 100 Printer.Print " DAILY EVALUATION REPORT " Printer.Print "---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" Printer.CurrentY = 1700 Printer.CurrentX = 200 Printer.Print "S/No" Printer.CurrentY = 1700 Printer.CurrentX = 1000 Printer.Print "Payment Type" Printer.CurrentY = 1700 Printer.CurrentX = 2500 Printer.Print "Name" Printer.CurrentY = 1700 Printer.CurrentX = 4500 Printer.Print "Room No." Printer.CurrentY = 1700 Printer.CurrentX = 5500 Printer.Print "Payment Date" Printer.CurrentY = 1700 Printer.CurrentX = 7000 Printer.Print "Amount" Printer.CurrentY = 1700 Printer.CurrentX = 8500 Printer.Print "Service Charge" Printer.CurrentY = 1700 Printer.CurrentX = 10000 Printer.Print "V.A.T" 'Printer.CurrentX = 100 Printer.Print "---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" 'For i = lvReport. To lvReport.ListItems.Add 'Do While lvReport.ListItems Printer.CurrentY = 2100 Printer.CurrentX = 1000 Printer.Print lvReport.ListItems.Item(i).SubItems(1) Printer.CurrentY = 2100 Printer.CurrentX = 2500 Printer.Print lvReport.ListItems.Item(i).SubItems(3) Printer.CurrentY = 2100 Printer.CurrentX = 4500 Printer.Print lvReport.ListItems.Item(i).SubItems(4) Printer.CurrentY = 2100 Printer.CurrentX = 5500 Printer.Print lvReport.ListItems.Item(i).SubItems(5) Printer.CurrentY = 2100 Printer.CurrentX = 7000 Printer.Print lvReport.ListItems.Item(i).SubItems(6) Printer.CurrentY = 2100 Printer.CurrentX = 8500 Printer.Print lvReport.ListItems.Item(i).SubItems(7) Printer.CurrentY = 2100 Printer.CurrentX = 10000

97

Printer.Print lvReport.ListItems.Item(i).SubItems(8) 'Wend End If End Sub Private Sub Form_Load() Top = 3000 Left = 3000 Connect filllist Combo1.AddItem "Name" Combo1.AddItem "Date" Combo1.AddItem "Payment Type" lblcount2.Caption = "" 'fillgrid End Sub Sub filllist() With lvReport .view = lvwReport .ColumnHeaders.Clear .ColumnHeaders.Add , , "S/No" .ColumnHeaders.Add , , "Payment Type" .ColumnHeaders.Add , , "Guest ID" .ColumnHeaders(3).Width = 2500 .ColumnHeaders.Add , , "Name" .ColumnHeaders(4).Width = 3000 .ColumnHeaders.Add , , "Room No" .ColumnHeaders.Add , , "Date of Payment" .ColumnHeaders(6).Width = 2500 .ColumnHeaders.Add , , "Amount" .ColumnHeaders.Add , , "Service Charge" .ColumnHeaders(8).Width = 2500 .ColumnHeaders.Add , , "VAT" End With Call Connect If RS_Paymentlog.State = adStateOpen Then RS_Paymentlog.Close RS_Paymentlog.Open "Select * from payment_log order by guestid", cnn, adOpenStatic, adLockOptimistic lvReport.ListItems.Clear With RS_Paymentlog While Not .EOF Set itm = lvReport.ListItems.Add(, , .RecordCount) itm.SubItems(1) = .Fields(3) itm.SubItems(2) = .Fields(0) itm.SubItems(3) = .Fields(1) itm.SubItems(4) = .Fields(5) itm.SubItems(5) = .Fields(10) itm.SubItems(6) = .Fields(6) itm.SubItems(7) = Val(.Fields(6)) / 100 * 10 itm.SubItems(8) = Val(.Fields(6)) / 100 * 5 .MoveNext Wend lblcount2.Caption = "Total Records = " & lvReport.ListItems.count End With Dim var As Integer Dim var2 As Integer

98

Dim var3 As Integer Dim i As Integer 'Declare variables ' ListCount = lvReport.ListItems.count 'count how many rows are in ListView ' For i = 1 To ListCount 'Go from 1st row to last var = var + lvReport.ListItems(i).SubItems(6) var2 = var2 + lvReport.ListItems(i).SubItems(7) var3 = var3 + lvReport.ListItems(i).SubItems(8) 'each loop, add value from listview to v ' ar 'replace the 1 in "(1)" with the column ' number '*column # starts at 0 '(i) is the row nuber Next i 'loop ' Text2.Text = var Text3.Text = var2 Text4.Text = var3 End Sub Sub Search_Name() lvReport.ListItems.Clear ' record variables Dim mark As Variant Dim count As Integer Call Connect count = 0 With RS_Payment 'listview1= .RecordCount + 1 r=1 .Find "name LIKE '" & Text1.Text & "%'" '.MoveFirst Do While Not .EOF 'continue if last find succeeded Set itm = lvReport.ListItems.Add(, , .Fields(3)) itm.SubItems(1) = .Fields(0) itm.SubItems(2) = .Fields(1) itm.SubItems(3) = .Fields(5) itm.SubItems(4) = .Fields(11) itm.SubItems(5) = .Fields(6) itm.SubItems(6) = Val(.Fields(6)) / 100 * 10 itm.SubItems(7) = Val(.Fields(6)) / 100 * 5 'count the last title found count = count + 1 ' note current position mark = .Bookmark

99

.Find "name LIKE '" & Text1.Text & "%'", 1, adSearchForward, mark ' above code skips current record to avoid finding the same row repeatedly; ' last arg (bookmark) is redundant because Find searches from current position 'r = r + 1 '.MoveNext Loop ' If count = 0 Then MsgBox "No Match Found", vbOKOnly + vbInformation, "Information" filllist Text1.SetFocus Else lblcount2.Caption = "Total Matches found " & count End If ' clean up RS_Payment.Close End With ' End Sub Sub Search_Date() lvReport.ListItems.Clear ' record variables Dim mark As Variant Dim count As Integer Call Connect count = 0 With RS_Payment 'listview1= .RecordCount + 1 r=1 .Find "Date_Modified LIKE '" & Text1.Text & "%'" '.MoveFirst Do While Not .EOF 'continue if last find succeeded Set itm = lvReport.ListItems.Add(, , .Fields(3)) itm.SubItems(1) = .Fields(0) itm.SubItems(2) = .Fields(1) itm.SubItems(3) = .Fields(5) itm.SubItems(4) = .Fields(11) itm.SubItems(5) = .Fields(6) itm.SubItems(6) = Val(.Fields(6)) / 100 * 10 itm.SubItems(7) = Val(.Fields(6)) / 100 * 5 'count the last title found count = count + 1 ' note current position mark = .Bookmark .Find "Date_Modified LIKE '" & Text1.Text & "%'", 1, adSearchForward, mark ' above code skips current record to avoid finding the same row repeatedly; ' last arg (bookmark) is redundant because Find searches from current position

100

'r = r + 1 '.MoveNext Loop ' If count = 0 Then MsgBox "No Match Found", vbOKOnly + vbInformation, "Information" filllist Text1.SetFocus Else lblcount2.Caption = "Total Matches found " & count End If ' clean up RS_Payment.Close End With ' End Sub Sub fillgrid() Connect 'flex1.Clear flex1.FormatString = "Enroll No|<Candidate Name |Father Name |Course Enrolled DOB " 'If RS_Payment.State = adStateOpen Then RS_Payment.Close If RS_Payment.RecordCount > 0 Then flex1.Rows = RS_Payment.RecordCount + 1 r=1 With RS_Payment .MoveFirst Do While Not .EOF flex1.TextMatrix(r, 0) = RS_Payment!GuestID If IsNull(!GuestID) = False Then flex1.TextMatrix(r, 1) = !GuestID If IsNull(!Name) = False Then flex1.TextMatrix(r, 2) = !Name If IsNull(!Payment_Type) = False Then flex1.TextMatrix(r, 3) = !Payment_Type If IsNull(!payment) = False Then flex1.TextMatrix(r, 4) = !Advance r=r+1 .MoveNext Loop 'End If 'End If 'End If 'End If End With 'End If End If End Sub

SEARCH EMPLOYEE FORM


Option Explicit Dim StrSql As String Public Sub FindX() ' connection and recordset variables

101

Dim Cnxn As New ADODB.Connection Dim rstName As New ADODB.Recordset Dim strCnxn As String Dim strSQLEmpName As String ' record variables Dim mark As Variant Dim count As Integer ' open connection lblcount.Caption = "" Set Cnxn = New ADODB.Connection strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _ & App.Path & "\database\HMS.mdb;Persist Security Info=False" Cnxn.Open strCnxn ' open recordset with default parameters which are ' sufficient to search forward through a Recordset Set rstName = New ADODB.Recordset strSQLEmpName = "SELECT Name FROM PresentEmp_Table" rstName.Open strSQLEmpName, Cnxn, adOpenStatic, adLockReadOnly, adCmdText count = 0 rstName.Find "Name LIKE '" & txtname.Text & "%'" Do While Not rstName.EOF 'continue if last find succeeded lstEmpName.AddItem rstName!Name 'count the last title found count = count + 1 ' note current position mark = rstName.Bookmark rstName.Find "Name LIKE '" & txtname.Text & "%'", 1, adSearchForward, mark ' above code skips current record to avoid finding the same row repeatedly; ' last arg (bookmark) is redundant because Find searches from current position Loop If count = 0 Then MsgBox "No Match Found", vbOKOnly + vbInformation, "Information" txtname.SetFocus Else lblcount.Caption = "Total Matches found " & count End If ' clean up rstName.Close Cnxn.Close Set rstName = Nothing Set Cnxn = Nothing End Sub Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdGo_Click() lstEmpName.Clear fraDetails.Visible = False

102

If txtname.Text = "" Then MsgBox "Enter the name", vbOKOnly + vbCritical, "Error" txtname.SetFocus Exit Sub End If FindX End Sub Private Sub Command1_Click() FindAll End Sub Private Sub Form_Load() fraDetails.Visible = False Me.Top = 3000 Me.Left = 3000 Call Connect lstEmpName.Clear End Sub Private Sub lstEmpName_Click() With Rs_Details .MoveFirst While Not .EOF If lstEmpName.List(lstEmpName.ListIndex) = .Fields(1) Then txtEmpNo.Text = .Fields(0) txtaddress.Text = .Fields(2) txtcity.Text = .Fields(3) txtState.Text = .Fields(4) txtpin.Text = .Fields(5) txtphone.Text = .Fields(6) txtDOJ.Text = .Fields(7) txteduqualification.Text = .Fields(8) txtdesignation.Text = .Fields(9) txtDept.Text = .Fields(10) txtExp.Text = .Fields(11) End If .MoveNext Wend fraDetails.Visible = True End With End Sub Public Sub FindAll() ' connection and recordset variables Dim Cnxn As New ADODB.Connection Dim rstName As New ADODB.Recordset Dim strCnxn As String Dim strSQLEmpName As String ' record variables Dim mark As Variant

103

Dim count As Integer ' open connection lblcount.Caption = "" Set Cnxn = New ADODB.Connection strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _ & App.Path & "\database\HMS.mdb;Persist Security Info=False" Cnxn.Open strCnxn ' open recordset with default parameters which are ' sufficient to search forward through a Recordset Set rstName = New ADODB.Recordset strSQLEmpName = "SELECT * FROM PresentEmp_Table" rstName.Open strSQLEmpName, Cnxn, adOpenStatic, adLockReadOnly, adCmdText ' count = 0 rstName.Find "Name " With rstName .MoveFirst While Not .EOF lstEmpName.AddItem .Fields(1) .MoveNext Wend count = .RecordCount End With If count = 0 Then MsgBox "No Match Found", vbOKOnly + vbInformation, "Information" txtname.SetFocus Else lblcount.Caption = "Total Matches found " & count End If ' clean up rstName.Close Cnxn.Close Set rstName = Nothing Set Cnxn = Nothing

End Sub

SERCH GUEST FORM


Option Explicit Dim StrSql As String Public Sub FindX() ' connection and recordset variables Dim Cnxn As New ADODB.Connection Dim rstName As New ADODB.Recordset Dim strCnxn As String Dim strSQLTitles As String ' record variables

104

Dim mark As Variant Dim count As Integer ' open connection lblcount.Caption = "" Set Cnxn = New ADODB.Connection strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _ & App.Path & "\database\HMS.mdb;Persist Security Info=False" Cnxn.Open strCnxn ' open recordset with default parameters which are ' sufficient to search forward through a Recordset Set rstName = New ADODB.Recordset strSQLTitles = "SELECT Name FROM CheckIn_Table" rstName.Open strSQLTitles, Cnxn, adOpenStatic, adLockReadOnly, adCmdText count = 0 rstName.Find "Name LIKE '" & txtname.Text & "%'" Do While Not rstName.EOF 'continue if last find succeeded lstGuestName.AddItem rstName!Name 'count the last title found count = count + 1 ' note current position mark = rstName.Bookmark rstName.Find "Name LIKE '" & txtname.Text & "%'", 1, adSearchForward, mark ' above code skips current record to avoid finding the same row repeatedly; ' last arg (bookmark) is redundant because Find searches from current position Loop If count = 0 Then MsgBox "No Match Found", vbOKOnly + vbInformation, "Information" txtname.SetFocus Else lblcount.Caption = "Total Matches found " & count End If ' clean up rstName.Close Cnxn.Close Set rstName = Nothing Set Cnxn = Nothing End Sub Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdGo_Click() lstGuestName.Clear fraDetails.Visible = False If txtname.Text = "" Then MsgBox "Enter the name", vbOKOnly + vbCritical, "Error" txtname.SetFocus Exit Sub End If

105

FindX End Sub Private Sub Command1_Click() ' connection and recordset variables Dim Cnxn As New ADODB.Connection Dim rstName As New ADODB.Recordset Dim strCnxn As String Dim strSQLEmpName As String ' record variables Dim mark As Variant Dim count As Integer ' open connection lblcount.Caption = "" Set Cnxn = New ADODB.Connection strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _ & App.Path & "\database\HMS.mdb;Persist Security Info=False" Cnxn.Open strCnxn ' open recordset with default parameters which are ' sufficient to search forward through a Recordset Set rstName = New ADODB.Recordset strSQLEmpName = "SELECT * FROM Checkin_Table" rstName.Open strSQLEmpName, Cnxn, adOpenStatic, adLockReadOnly, adCmdText ' count = 0 rstName.Find "Name " With rstName .MoveFirst While Not .EOF lstGuestName.AddItem .Fields(2) .MoveNext Wend count = .RecordCount End With If count = 0 Then MsgBox "No Match Found", vbOKOnly + vbInformation, "Information" txtname.SetFocus Else lblcount.Caption = "Total Matches found " & count End If ' clean up rstName.Close Cnxn.Close Set rstName = Nothing Set Cnxn = Nothing

End Sub

106

Private Sub Form_Load() fraDetails.Visible = False Me.Top = 3000 Me.Left = 3000 Connect lstGuestName.Clear End Sub Private Sub lstGuestName_Click() With Rs_Detail .MoveFirst While Not .EOF If lstGuestName.List(lstGuestName.ListIndex) = .Fields(2) Then Text13.Text = .Fields(0) Text1.Text = .Fields(1) Text2.Text = .Fields(3) Text3.Text = .Fields(4) Text4.Text = .Fields(5) Text5.Text = .Fields(6) Text6.Text = .Fields(8) Text7.Text = .Fields(7) Text8.Text = .Fields(9) Text9.Text = .Fields(10) Text10.Text = .Fields(11) Text11.Text = .Fields(12) Text12.Text = .Fields(13) Text1.Locked = True Text2.Locked = True Text3.Locked = True Text4.Locked = True Text5.Locked = True Text6.Locked = True Text7.Locked = True Text8.Locked = True Text9.Locked = True Text10.Locked = True Text11.Locked = True Text12.Locked = True Text13.Locked = True End If .MoveNext Wend fraDetails.Visible = True End With End Sub

SIDE BAR FORM


Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button) On Error Resume Next

107

Select Case Button.Key Case "Align Left" 'ToDo: Add 'Align Left' button code. MsgBox "Add 'Align Left' button code." Case "Align Right" 'ToDo: Add 'Align Right' button code. MsgBox "Add 'Align Right' button code." Case "Bold" 'ToDo: Add 'Bold' button code. MsgBox "Add 'Bold' button code." Case "Button" 'ToDo: Add 'Button' button code. MsgBox "Add 'Button' button code." Case "Center" 'ToDo: Add 'Center' button code. MsgBox "Add 'Center' button code." Case "Copy" 'ToDo: Add 'Copy' button code. MsgBox "Add 'Copy' button code." Case "Cut" 'ToDo: Add 'Cut' button code. MsgBox "Add 'Cut' button code." Case "Italic" 'ToDo: Add 'Italic' button code. MsgBox "Add 'Italic' button code." Case "Justify" 'ToDo: Add 'Justify' button code. MsgBox "Add 'Justify' button code." End Select End Sub Private Sub Command2_Click() On Error GoTo Err Shell "calc.exe", vbNormalFocus Exit Sub Err: MsgBox "You don't have a Calculator installed in your computer.", vbExclamation, "CSRS version 1" End Sub Private Sub Command3_Click() On Error GoTo Err Shell "notepad.exe", vbNormalFocus Exit Sub Err: MsgBox "You don't have a NotePad installed in your computer.", vbExclamation, "CSRS version 1" End Sub Private Sub Command4_Click() frmChangePassword.Show End Sub Private Sub Form_Load() Me.Left = 0 Me.Top = 0 Label2.Caption = Format(Date, "long date")

108

Label1.Caption = Format(Now, "long time") Label18.Caption = "You are logged on as: " Label17.Caption = UserName End Sub Private Sub Form_Unload(Cancel As Integer) Exit Sub End Sub Private Sub Image10_Click() Label12_Click End Sub Private Sub Image11_Click() Label13_Click End Sub Private Sub Image12_Click() Label14_Click End Sub Private Sub Image13_Click() Label15_Click End Sub Private Sub Image14_Click() Label16_Click End Sub Private Sub Image15_Click() frmReport.Show 1 End Sub Private Sub Image16_Click() frmBar.Show 1 End Sub Private Sub Image4_Click() Label6_Click End Sub Private Sub Image5_Click() Label7_Click End Sub Private Sub Image6_Click() Label8_Click End Sub Private Sub Image7_Click() Label9_Click End Sub Private Sub Image8_Click() Label10_Click End Sub Private Sub Image9_Click() Label11_Click End Sub

109

Private Sub Label10_Click() frmSearchEmp.Show 1 End Sub Private Sub Label11_Click() Shell "c:\windows\system32\control.exe", vbNormalFocus End Sub Private Sub Label12_Click() Shell "calc.exe", vbNormalFocus End Sub Private Sub Label13_Click() Shell "notepad", vbNormalFocus End Sub Private Sub Label14_Click() frmChangePassword.Show 1 End Sub Private Sub Label15_Click() If MsgBox("Are you sure you want to Log Off User?", vbYesNo) = vbYes Then MDIMain.Hide frmLogin.Show End If End Sub Private Sub Label16_Click() If MsgBox("Are you sure you want to quit?", vbInformation + vbYesNo) = vbYes Then MsgBox "Thank you for using this application " & login, vbOKOnly, " " & Date & " " & Time Else: Exit Sub End If With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "Log Out" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With End End Sub Private Sub Label20_Click() frmReport.Show 1 End Sub Private Sub Label21_Click() Image16_Click End Sub Private Sub Label6_Click() frmcheckIn.Show 1 End Sub Private Sub Label6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Label6.MousePointer = hourglass

110

End Sub Private Sub Label7_Click() frmCheckOut.Show 1 End Sub Private Sub Label8_Click() frmSearchGuest.Show 1 End Sub Private Sub Label9_Click() frmStatus.Show 1 End Sub SPLASH FORM Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button) On Error Resume Next Select Case Button.Key Case "Align Left" 'ToDo: Add 'Align Left' button code. MsgBox "Add 'Align Left' button code." Case "Align Right" 'ToDo: Add 'Align Right' button code. MsgBox "Add 'Align Right' button code." Case "Bold" 'ToDo: Add 'Bold' button code. MsgBox "Add 'Bold' button code." Case "Button" 'ToDo: Add 'Button' button code. MsgBox "Add 'Button' button code." Case "Center" 'ToDo: Add 'Center' button code. MsgBox "Add 'Center' button code." Case "Copy" 'ToDo: Add 'Copy' button code. MsgBox "Add 'Copy' button code." Case "Cut" 'ToDo: Add 'Cut' button code. MsgBox "Add 'Cut' button code." Case "Italic" 'ToDo: Add 'Italic' button code. MsgBox "Add 'Italic' button code." Case "Justify" 'ToDo: Add 'Justify' button code. MsgBox "Add 'Justify' button code." End Select End Sub Private Sub Command2_Click() On Error GoTo Err Shell "calc.exe", vbNormalFocus Exit Sub Err: MsgBox "You don't have a Calculator installed in your computer.", vbExclamation, "CSRS version 1" End Sub Private Sub Command3_Click() On Error GoTo Err

111

Shell "notepad.exe", vbNormalFocus Exit Sub Err: MsgBox "You don't have a NotePad installed in your computer.", vbExclamation, "CSRS version 1" End Sub Private Sub Command4_Click() frmChangePassword.Show End Sub Private Sub Form_Load() Me.Left = 0 Me.Top = 0 Label2.Caption = Format(Date, "long date") Label1.Caption = Format(Now, "long time") Label18.Caption = "You are logged on as: " Label17.Caption = UserName End Sub Private Sub Form_Unload(Cancel As Integer) Exit Sub End Sub Private Sub Image10_Click() Label12_Click End Sub Private Sub Image11_Click() Label13_Click End Sub Private Sub Image12_Click() Label14_Click End Sub Private Sub Image13_Click() Label15_Click End Sub Private Sub Image14_Click() Label16_Click End Sub Private Sub Image15_Click() frmReport.Show 1 End Sub Private Sub Image16_Click() frmBar.Show 1 End Sub Private Sub Image4_Click() Label6_Click End Sub Private Sub Image5_Click() Label7_Click

112

End Sub Private Sub Image6_Click() Label8_Click End Sub Private Sub Image7_Click() Label9_Click End Sub Private Sub Image8_Click() Label10_Click End Sub Private Sub Image9_Click() Label11_Click End Sub Private Sub Label10_Click() frmSearchEmp.Show 1 End Sub Private Sub Label11_Click() Shell "c:\windows\system32\control.exe", vbNormalFocus End Sub Private Sub Label12_Click() Shell "calc.exe", vbNormalFocus End Sub Private Sub Label13_Click() Shell "notepad", vbNormalFocus End Sub Private Sub Label14_Click() frmChangePassword.Show 1 End Sub Private Sub Label15_Click() If MsgBox("Are you sure you want to Log Off User?", vbYesNo) = vbYes Then MDIMain.Hide frmLogin.Show End If End Sub Private Sub Label16_Click() If MsgBox("Are you sure you want to quit?", vbInformation + vbYesNo) = vbYes Then MsgBox "Thank you for using this application " & login, vbOKOnly, " " & Date & " " & Time Else: Exit Sub End If With RS_Userlog .AddNew .Fields(0) = UserName .Fields(1) = "Log Out" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With End

113

End Sub Private Sub Label20_Click() frmReport.Show 1 End Sub Private Sub Label21_Click() Image16_Click End Sub Private Sub Label6_Click() frmcheckIn.Show 1 End Sub Private Sub Label6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Label6.MousePointer = hourglass End Sub Private Sub Label7_Click() frmCheckOut.Show 1 End Sub Private Sub Label8_Click() frmSearchGuest.Show 1 End Sub Private Sub Label9_Click() frmStatus.Show 1 End Sub

STATUS FORM
Option Explicit Dim SR, DR, SUR, DSUR, i, J, SR1, DR1, SUR1, DSUR1 As Integer Private Sub cmdcloase_Click() Unload Me End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Call Connect lbltotalroomvalue(0).Caption = "100" lblSingleRoomValue(0).Caption = "40" lblDoubleRoomValue(0).Caption = "40" lblSuiteRoomValue(0).Caption = "10" lblDeluxeSuiteValue(0).Caption = "10" With RS_SingleRoom .MoveFirst SR = .RecordCount lblSingleRoomValue(1).Caption = SR End With With RS_DoubleRoom

114

.MoveFirst DR = .RecordCount lblDoubleRoomValue(1).Caption = DR End With With RS_SuiteRoom .MoveFirst SUR = .RecordCount lblSuiteRoomValue(1).Caption = SUR End With With RS_DeluxeSuite .MoveFirst DSUR = .RecordCount lblDeluxeSuiteValue(1).Caption = DSUR End With i = SR + DR + SUR + DSUR lbltotalroomvalue1.Caption = i J = lbltotalroomvalue(0).Caption - i lbloccupiedRoomvalue1.Caption = J SR1 = lblSingleRoomValue(0).Caption - SR lblSingleRoomValue(2).Caption = SR1 DR1 = lblDoubleRoomValue(0).Caption - DR lblDoubleRoomValue(2).Caption = DR1 SUR1 = lblSuiteRoomValue(0).Caption - SUR lblSuiteRoomValue(2).Caption = SUR1 DSUR1 = lblDeluxeSuiteValue(0).Caption - DSUR lblDeluxeSuiteValue(2).Caption = DSUR1 End Sub

TIP OF THE DAY FORM


Option Explicit ' The in-memory database of tips. Dim Tips As New Collection ' Name of tips file Const TIP_FILE = "TIPOFDAY.TXT" ' Index in collection of tip currently being displayed. Dim CurrentTip As Long Private Sub DoNextTip() ' Select a tip at random. CurrentTip = Int((Tips.count * Rnd) + 1) ' Or, you could cycle through the Tips in order ' ' ' ' CurrentTip = CurrentTip + 1 If Tips.Count < CurrentTip Then CurrentTip = 1 End If

115

' Show it. frmTip.DisplayCurrentTip End Sub Function LoadTips(sFile As String) As Boolean Dim NextTip As String ' Each tip read in from file. Dim InFile As Integer ' Descriptor for file. ' Obtain the next free file descriptor. InFile = FreeFile ' Make sure a file is specified. If sFile = "" Then LoadTips = False Exit Function End If ' Make sure the file exists before trying to open it. If Dir(sFile) = "" Then LoadTips = False Exit Function End If ' Read the collection from a text file. Open sFile For Input As InFile While Not EOF(InFile) Line Input #InFile, NextTip Tips.Add NextTip Wend Close InFile ' Display a tip at random. DoNextTip LoadTips = True End Function Private Sub chkLoadTipsAtStartup_Click() ' save whether or not this form should be displayed at startup SaveSetting App.EXEName, "Options", "Show Tips at Startup", chkLoadTipsAtStartup.Value End Sub Private Sub cmdNextTip_Click() DoNextTip End Sub Private Sub cmdOK_Click() Unload Me End Sub Private Sub Form_Load() Dim ShowAtStartup As Long ' See if we should be shown at startup ShowAtStartup = GetSetting(App.EXEName, "Options", "Show Tips at Startup", 1) If ShowAtStartup = 0 Then Unload Me

116

Exit Sub End If ' Set the checkbox, this will force the value to be written back out to the registry Me.chkLoadTipsAtStartup.Value = vbChecked ' Seed Rnd Randomize ' Read in the tips file and display a tip at random. If LoadTips(App.Path & "\" & TIP_FILE) = False Then lblTipText.Caption = "That the " & TIP_FILE & " file was not found? " & vbCrLf & vbCrLf & _ "Create a text file named " & TIP_FILE & " using NotePad with 1 tip per line. " & _ "Then place it in the same directory as the application. " End If End Sub Public Sub DisplayCurrentTip() If Tips.count > 0 Then lblTipText.Caption = Tips.Item(CurrentTip) End If End Sub

VIEW USER FORM


Private Sub Command1_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Me.Hide End Sub Private Sub Command2_Click() Me.Hide frmAddUser.Show 1 End Sub Private Sub Form_Load() Me.Top = 3000 Me.Left = 3000 Connect With RS_Password .MoveFirst While Not .EOF List1.AddItem .Fields(0) .MoveNext Wend ' stsMain.Panels(1) = LVmain.ListItems.count & Space(1) & "Records in the Database" 'lblcount = List1.count & " " & "Records Currently in the Database" End With End Sub Private Sub List1_Click() With RS_Password .MoveFirst While Not .EOF

117

If List1.List(List1.ListIndex) = .Fields(0) Then Text1.Text = .Fields(0) Text2.Text = .Fields(1) Text3.Text = .Fields(3) End If .MoveNext Wend End With End Sub

WELCOME FORM
'Const HWND_TOPMOST = -1 'Const HWND_NOTOPMOST = -2 'Const SWP_NOSIZE = &H1 'Const SWP_NOMOVE = &H2 'Const SWP_NOACTIVATE = &H10 'Const SWP_SHOWWINDOW = &H40 Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Dim i As Integer Private Sub popup() On Error Resume Next Picture1.Visible = True i = Me.Height Me.Height = 0 While Me.Height < i Me.Height = Me.Height + 2 Me.Top = Me.Top - 2 DoEvents Wend End Sub Private Sub popdown() On Error Resume Next i = Me.Height While Me.Height > 500 Me.Height = Me.Height - 2 Me.Top = Me.Top + 2 DoEvents Wend End Sub Private Sub Form_Activate() On Error Resume Next mdi_start.Enabled = False lbl_user.Caption = UserName lbl_time.Caption = "Login at:" & Format$(Now, "hh:mm:ss AM/PM") lbl_day.Caption = "Today:" & Format$(Date, "dd-MMM-yy") Call popup 'SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE 'Sleep welcometime 'Wait for 1 Seconds 'Call popdown main_menu.Enabled = True 'Unload Me

118

End Sub

Private Sub Form_KeyPress(KeyAscii As Integer) Unload Me End Sub Private Sub Form_Load() frmWelcome.Caption = UserName On Error Resume Next Me.Left = Screen.Width - (Me.Width + 50) Me.Top = Screen.Height - 450 '450 assumed height for taskbar Picture1.Visible = False End Sub

RESET PAY FORM


Private Sub Command1_Click() If Combo1.ListIndex = -1 Then MsgBox "Pls Enter a Month you want to Deleted", vbCritical, "Error" Exit Sub End If With RS_Payrolllog .AddNew .Fields(0) = RS_Payroll.Fields(0) .Fields(1) = RS_Payroll.Fields(1) .Fields(2) = RS_Payroll.Fields(2) .Fields(3) = RS_Payroll.Fields(3) .Fields(4) = RS_Payroll.Fields(4) .Fields(5) = RS_Payroll.Fields(5) .Fields(6) = RS_Payroll.Fields(6) .Fields(7) = RS_Payroll.Fields(7) .Fields(8) = RS_Payroll.Fields(8) .Fields(9) = RS_Payroll.Fields(9) .Fields(10) = RS_Payroll.Fields(10) .Fields(11) = RS_Payroll.Fields(11) .Fields(12) = RS_Payroll.Fields(12) .Fields(13) = RS_Payroll.Fields(13) .Fields(14) = Date .Fields(15) = UserName .Update End With With RS_Payroll .MoveFirst While Not .EOF If Combo1.Text = .Fields(4) Then .Delete adAffectCurrent End If .MoveNext Wend End With MsgBox "Records Successfully Deleted", vbInformation Me.Hide With RS_Userlog .AddNew .Fields(0) = UserName

119

.Fields(1) = "Reset Payroll Records" .Fields(2) = Date .Fields(3) = Time .Fields(4) = "Successful" .Update End With End Sub Private Sub Form_Load() Connect Combo1.AddItem "January" Combo1.AddItem "February" Combo1.AddItem "March" Combo1.AddItem "April" Combo1.AddItem "May" Combo1.AddItem "June" Combo1.AddItem "July" Combo1.AddItem "August" Combo1.AddItem "September" Combo1.AddItem "October" Combo1.AddItem "November" Combo1.AddItem "December" End Sub

EMPLOYEE REPORT FORM


Dim rs As ADODB.Recordset Dim db As ADODB.Connection Dim status As Boolean Dim str As String Private Sub Command1_Click() 'If (Combo1.Text <> "All" And Combo1.Text <> "Book ID") Then 'MsgBox "Please select proper Book specifications.", vbCritical, "Invalid Data" 'Exit Sub 'End If 'If (Combo1.Text = "All") Then 'str = "Select * from PresentEmp_Table" If (Combo1.Text <> "") Then 'If (Text1.Text <> "") Then ' If IsNumeric(Text1.Text) Then str = "Select * from PresentEmp_Table where Empid=" & Combo1.Text 'Else 'MsgBox ("Please enter Book ID Numeric value."), vbExclamation, "Invalid value" 'Exit Sub 'End If Else MsgBox ("Please enter Book ID."), vbExclamation, "Invalid value" Exit Sub 'End If End If again: If (status = False) Then rs.Open str, db, adOpenDynamic, adLockPessimistic status = True Else

120

rs.Close status = False GoTo again End If Set DataReport1.DataSource = rs DataReport1.Show vbModal End Sub Private Sub Form_Load() Set db = New ADODB.Connection Set rs = New ADODB.Recordset db.CursorLocation = adUseClient db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " _ & App.Path & ".\Database\HMS.mdb;Persist Security Info=False" status = False Connect With Rs_Details .MoveFirst While Not .EOF Combo1.AddItem .Fields(0) .MoveNext Wend End With End Sub

121

TESTING:
No system design is ever perfect. Communication problems, programmers negligence or time constraints create errors that must be eliminated before the system is ready for user acceptance testing. A system is tested for online response, volume of transactions, stress, recovery from failure and usability. The objective of system testing is to ensure that all individual programs are working as expected. Software testing is the process of testing the software product. Effective software will contribute to the delivery of the higher quality software products, more satisfied users , lower maintenance cost and more accurate and reliable results and ineffective testing will adversely affect these factors. Hence software testing is necessary and important activated of software development process. The first test of a system is to see whether it produces the correct output. Following this step a variety of other tests are conducted.

LEVELS OF TESTING: 1)UNIT TESTING: Unit testing is the process of taking a module and running it in isolation from the rest of the software product by using prepared test cases and comparing the actual results with the results predicted by the specifications and design of the module? One purpose of testing is to find and remove as many errors in the software as practical. There are number of reasons in support of unit testing than testing the entire product: -

122

1.) The size of a single module is small enough that we can locate an error fairly easily. 2.) The module is small enough that we can attempt to test it in some demonstrably exhaustive fashion. 3.) Confusing interactions of multiple errors in widely different parts of the software are eliminated.

3.)

INTEGRATION TESTING: -

The purpose of unit testing is to determine that each independent module is correctly implemented. This gives little chance to determine that the interface between modules is also correct, and for this reason integration testing must be performed. One specific target of integration testing is the interface: whether parameters match on both sides as to type, permissible ranges, meaning and utilization. There are several classical integration strategies that really have little basis in a rational methodology. Top downintegration proceeds down the invocation hierarchy, adding one module at a time until an entire tree level is integrated, and thus it eliminates the need for drivers. The bottom up strategy works similarly from the bottom and has no need of stubs. A sandwich strategy runs from top and bottom concurrently, meeting some ware in the middle.

123

4.)

SYSTEM TESTING: -

Of the three levels of testing, the system level is closest to everyday experience. A common pattern in these familiar forms is that we evaluate a product in terms of our expectations, not with the respect to a specification or a standard. Consequently, goal is not to find faults, but to demonstrate performance. Because of this we tend to approach system testing from a functional standpoint rather than from a structural one. Since it is so intuitively familiar, system testing in practice tends to be less formal than it might be, and is compounded by the reduced testing interval that usually remains before a delivery deadline. The software should actually be tested on many different hardware set ups, although the full range of memory, processor, operating system, and peripheral possibilities may be to large for complete testing. There are many types of specifications, and we should be aware of those as we perform system testing. There are many instance, there may be a specified level of performance required of the software this may involve measurement of response time under various loads and operating conditions. It may also require measurement of main and disk memory usage. Software reliability should also be measured during all other tests of the integrated product.

124

TESTING FORMS: WITH ERROR FORM:

WITHOUT ERROR FORM:

125

126

127

INPUT-OUTPUT FORMS:

128

129

IMPLEMENTATION:
The implementation phase is less creative than the system design. It is primarily concerned with user training, site preparations, and file conversions. The implementation process includes three basic questions: What is the actual operation? Are user manual ready? Are there delays in loading files? System design checks the readiness and accuracy of the system to access, update and retrieve data from new files. Once the programs become available, test data are read into the computer and processed against the files provided for testing. If successful the program is then run with live data. Otherwise a diagnostic procedure is used to locate and correct errors in the program. The implementation process involves several changeover procedures that

130

are as follows:

DIRECT CHANGEOVER:
This method is the complete replacement of the old system by the new in one move. It is a bold move, which should be undertaken only when everyone concerned has confidence in the new system.

PARALLEL RUNNING:

Parallel running or operation means processing current data by both the old and new systems to cross-check the results.

PILOT RUNNING:
Pilot running is similar in concept to parallel running. Data from one or more previous periods for the whole or part of the system is run on the new system after results have been obtained from the old system, and the new results are compared with the old.

STAGED CHANGEOVER:

A staged turnover involves a series of limited-size direct changeovers, the new system being introduced piece by piece. A complete part, or logical section is committed to the new system while the remaining parts or sections are processed by the old system. Only when the selected part is operating satisfactory is the remainder transferred.

131

MAINTENANCE:
Software maintenance is a very broad activity that includes error corrections, enhancements of capabilities, deletion of obsolete capabilities, and optimization. Because change is inevitable, mechanisms must be developed for evaluating, controlling and making modifications. So any work done to change the software after it is in operation is considered to be maintenance work. The purpose is to preserve the value of software over time. Expanding the customer base, meeting additional requirements, becoming easier to use, and more efficient and employing newer technology can enhance the value.

CATEGORIES OF MAINTENANCE:-

1.) CORRECTIVE MAINTENANCE:This refers to modifications initiated by defects in the software. A defect can result from design errors, logic errors and coding errors. Design errors occur when changes made to the software are incorrect, incomplete, wrongly communicated or the change request is misunderstood. Logic errors result from invalid tests and conclusions, incorrect implementation of design specifications, faulty logic flow or incomplete test data. Coding errors are caused by incorrect implementation of detailed logic design and incorrect use of the source code logic. Defects are also caused by data processing errors and system performance errors.

132

2.) ADAPTIVE MAINTENANCE: It includes modifying the software to match changes in the ever changing environment. The term environment in this context refers to the totally of all conditions and influences which act from outside upon the software, for example, business rules, government policies, work patterns, software and hardware operating platforms. A change to the whole or part of this environment will require a corresponding modification of the software. Thus, this type of maintenance includes any work initiated as a consequence of moving the software to a different hardware or software platform compiler, operating system or new processor.

3.) PERFECTIVE MAINTENANCE: It means improving processing efficiency or performance, or restructuring the software to improve changeability. When the software becomes useful, the user tends to experiment with new cases beyond the scope for which it was initially developed. Expansion in requirements can take the form of enhancement of existing system functionally or improvement in computational efficiency. Hence, perfective maintenance refers to enhancements, making the product better, faster, smaller, better documented, cleaner structured, with more functions or reports.

133

134

BIBLIOGRAPHY

Name of the book/website



Author
Vipan Arora Sumita Arora Elias M. Awad

Information Practices Information Practices System Analysis and design


http://en.wikipedia.org/wiki/Microsoft_Access http://en.wikipedia.org/wiki/Visual_Basic

135

You might also like