0% found this document useful (0 votes)
38 views73 pages

Herbaldoc

The document describes a herbal management system project that was developed using Visual Basic 6.0 and MS Access. It provides details on the system analysis, hardware and software specifications, program specification and features of various controls used in Visual Basic like textbox, timer, toolbar, label, listbox, combobox, checkbox and command button.

Uploaded by

Raj Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views73 pages

Herbaldoc

The document describes a herbal management system project that was developed using Visual Basic 6.0 and MS Access. It provides details on the system analysis, hardware and software specifications, program specification and features of various controls used in Visual Basic like textbox, timer, toolbar, label, listbox, combobox, checkbox and command button.

Uploaded by

Raj Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 73

CONTENTS

Introduction

Synopsis

System Specification

Hardware Configuration
Software Configuration

System Analysis

Existing System
Proposed System

Program Specification

Future Enhancement

Conclusion

Appendix

A. Table design
B. Data Flow Diagram
C. Source Code
D. Output Screen

Bibliography
SYNOPSIS

The project entitled “HERBAL MANAGEMENT SYSTEM” was enveloped at

herbal Agencies. The main aim of this project is to computerize all the works in the

organization.

The herbal management system has developed in Visual basic 6.0 and Ms access.

First, we will enter the username and password and their check it. If it correct then it will

allow the user to enter into the program section. This system consists of various sub

modules.

The various sub modules are.

1) Customer details
2) Stock entry
3) Stock details
4) Herbal details
5) Sales details
6) Bill preparation
7) Salesman details
The customer details has the following sub division

1. Herbal
2. Agencies
3. Hospital
Reports

1) Customer wise
2) Stock wise
3) Herbal wise
4) Sales wise
5) Salesman wise
2. Hardware and Software Specification

2.1 Hardware Specification

Processor : PENTIUM III

CPU Clock : 933 MHz.

RAM : 128 MB

Base Memory : 640 K

Hard Disk Drive (HDD) : 40 GB

Floppy Disk Drive (FDD) : 1.44 MB

Display type : SVGA Color

Serial Ports : 3F2F8

Parallel Ports : 378

2.2 Software Requirements

Operating System : Windows NT


Back End : MS-Access 2000
Front End : Visual Basic 6.0
SYSTEM ANALISYS

PROBLEM DEFINITION
The project HERBAL MANAGEMET SYSTEM in which all herbal item of a
company is maintained. The day today reports are collected and processed by the
company.

EXISTING SYSTEM
The existing system is not a interactive processing system, because it uses
FOXPRO. The old version used FoxPro is the semi RDBMS and there is no interactive
report generation method.

DRAW BACK OF THE EXISTING SYSTEM:

 There is no module in the enquiry.


 Data retrieval is difficult and lot of time will be spent process.
 There is no report generation method.
 During the transaction so many errors will occur.
 Human effort is wasted to prepare reports.
 Credit Transaction process is very difficult.

PROPOSED SYSTEM:
 Our proposed system, data is maintained correctly.
 The execution speed is very faster. Calculation will be accurate
 Reduces computation time in preparation of various reports.
 Up to date sales can be maintained
 Recording all the day transaction
3. SOFTWARE SPECIFICATION

3.1.ABOUT VISUAL BASIC 6.0

Microsoft Visual Basic is one of the best GUIs and version 6.0 is the latest
version of the popular programming language. With its new features, Visual Basic is an
even stronger contender in the application development area then ever before.
Microsoft Visual Basic, the fastest and easiest to create applications for Microsoft
windows. Visual Basic provides with a complete set of tools to simplify Rapid
Application Development (RAD).

WHAT IS VISUAL BASIC 6.0?

The “Visual” part refers to the method used to create the graphical user interface
(GUI), Rather than writing numerous lines of code to describe the appearance and
location of interface elements, we simply add rebuilt objects into place on screen. The
“Basic” part refers to the BASIC (Beginners All - Purpose Symbolic Instruction Code)
language, a language used by more programmers than any other language in the history
of computing. Visual Basic has evolved from the original BASIC language and now
contains several hundred statements, functions and keywords, many of which relate
directly to the windows GUI.
The purpose of Visual Basic is to develop robust stand-alone application, games,
and utilities less time than it takes in other languages. We can use also ActiveX
technology to create internet-enabled applications that are limited only by our
imagination.
Visual Basic 6.0 is the newest addition to the family of Visual Basic products. It
allows us to create Windows applications for our PC without being an expert in C++ or
other programming languages.
Visual Basic 6.0 is specially designed to utilize the Internet. It comes with several
controls that allow us to create web-based applications called ActiveX executables. They
will work just like stand-alone visual basic application, but they are accessed through the
Microsoft Internet explorer 3.1 Web browser. This allows us to revise our applications
and distribute them through the Internet.
Some new features in visual basic 6.0 are given below:
 VB 6.0 is most productive tool for creating high-performance enterprise
and web-based applications.
 VB 6.0 integrated visual database tools and new data environment
designer can visually design oracle and MS SQL sever databases and create
reusable data access queries all without leaving the VB environment.
 Data report designer can quickly drag and drop custom data-bound
controls to create forms or reports. Creation of custom data hierarchies is as
easy as filling out a dialog box and dragging the command to the form.
 VB 6.0 professional edition is designed for individual professional or
corporate developer who needs to create a client/server or Internet based
applications.
 With the emergence of dynamic HTML page designer, multimedia rich
applications can be developed using the document.
 Object model and dynamic HTML surface.

ADO CONTROL:

The ADO Data control user Microsoft ActiveX Data Objects (ADO) to quickly
create connections between data-bound control and data provides. Data-bound controls
are any controls that feature a Data Source property. Data provides can be any source
written to the OLEDB specification. We can also easily create our own data provider
using Visual Basic’s class module.
Although we can use the ActiveX Data Objects directly in our applications, the
ADO Data control has the advantage of being a graphic control (with back and Forward
buttons) and an easy-to-use interface that allows we to create database applications with a
minimum of code.
USES:

 Connect to a local or remote database.


 Open a specification database table or define a set of records based on a
Structured Query Language (SQL) query of stored procedure or view of the
tables in that database.
 Pass data field values to data-bound controls, where we can display or
change the values.
 Add new records of update a database based on any changes make to data
displayed in the bound controls.

DATA REPORTS:
The Microsoft Data Reports designer is a versatile data report generator that
features the ability to be created, banded hierarchical reports. Used in conjunction with a
data source such as the Data Environment designer, we can create reports from several
different relational data tables. In addition on to creating printable reports, we can also
export the report to HTML or text files.

TEXTBOX:

A Text Box control, sometimes called an edit field or edit control, displays
information entered at design time, entered by the user, or assigned to the control in code
at run time.
TIMER:

A Timer control can execute code at regular intervals by causing a Timer event to
occur. The timer control, invisible to the user, is useful for background processing
TOOL BAR:

A Toolbar control contains a collection of Button objects used to create a toolbar


that is associated with an application.
LABEL:

A Label control is a graphical control and we can use to display text that a user
can’t change directly.
LIST BOX:

A List Box control displays a list of items from which the user can select one or
more, if the number of items exceeds the number that can be displayed, a scroll bar is
automatically added to the List Box control. If no item is selected, the List Index property
value is -1. The first item in the list is List Index 0, and the value of the List Count
property is always one more than the largest List Index value.
COMBO BOX:

A Combo Box control combines the features of a Text Box control and List Box
control-users can enter information in the text box portion or select an item from the list
box portion of the control.
CHECK BOX:

A Check Box control displays an X when selected; the X disappears when the
Check Box is cleared. Use this control to give the user a True/False of Yes/No option.
We can use Check Box controls in, groups to display multiple choices from which the
user can select one or more. We can also set the value of a heck Box programmatically
with the Value property.
COMMAND BUTTON:

Use a Command Button control to begin, interrupt, OT ends a process.When


chosen, a command Button appears pushed in and so is sometimes called a push button.
DRIVE LIST BOX:

A Drive List Box control enables a user select a valid drive at run time.
Use this control to display a list of all the valid drives in a user’s system. We can
create dialog box that enable the user to open a file from a list of files on a disk in any
available drive.
FILE LIST BOX CONTROL:

A File List Box control locates and lists files in the directory specified by the Path
property at run time. We use this control to display a list of files selected by file type. We
can create dialog boxes in our application that, for example, enables the user to select a
file or group of files.
SCROLL BAR CONTROLS:

Scroll bars provide easy navigation through a long list of items or a large amount of
information.
STATUS BAR CONTROL:

A Status Bar control provides a window, usually at the bottom of a parent from,
through, which an application can display, various kinds of status data. The status Bar
can be divided up into a maximum of sixteen panel objects that are contained in a Panels
collection.
EVENTS:

An event is a specific action that occurs on or with a certain object. Visual Basic
can respond to a variety of events: mouse clicks, changes in data, forms opening or
closing, and many others. Events are usually the result of user action.
DELETE:

The delete event occurs when the user performs some action, such as pressing the
DEL key, to delete a record, but before the record is actually deleted.
CHANGE EVENT:

The change event occurs when the contents of a text box or the text portion of a
combo box change. It also occurs when we move from one page to another page in a tab
control. Examples of this event include entering a character directly in the text box or
combo box or changing the control’s Text property setting by using a macro or Visual
Basic.
LOAD and UNLOAD EVENTS

The Load event occurs when a form is opened and its records are displayed.
The Unload event occurs after a form is closed but before it’s removed from the screen.
When the form is reloaded, Microsoft Access redisplays the form and reinitializes the
contents of all controls.
3.2 MS-ACCESS 2000

A database is a collection of information related to a particular subject or purpose,

such as tracking customer order or maintaining music collection. If our database isn’t

stored on a computer, or only parts of it are, we may be tracking information from a

variety of sources that we have to coordinate and organize ourselves.

TABLES:

In table Design view, we can create an entire table from scratch, or add, delete, or
customize an existing table’s fields.

FORMS:

We can use forms for a variety of purposes. Most of the information in a form
comes from an underlying record source. Other information in the form is stored in the
form’s design. We create the kink between a form and its record source by using
graphical called controls. The most common type of control used to display and enter
data is a text box.

REPORTS:

A report is an effective way to present our data in a printed format. Because we


have control over the size and appearance of everything on a report, we can display the
information the way we want to see it.

Most of the information in a report comes from an underlying table, query, or


SQL statement, which is the source of the reports data. Other information in the report is
stored in the report’s design.

MODULE:

A module is a collection of Visual Basic for Applications declarations and


procedures that are stored together as a unit.
GUARANTEE ACCESS:

We can design a multiple-table query to automatically fill in certain field values


for a new record. When we enter a value in the join field in the query or in a from based
on the query, Microsoft Access looks up and fills in existing information related to that
value. For example, if we know the value in the join field between a Customer table and
an Orders table (typically, a customer identifier such as Customer ID), we could enter the
customer ID and have Microsoft Access enter the rest of the information for that
customer. If no matching information is found, Microsoft Access displays an error
message then the focus leaves the record.

SYSTEMETIC TREATMENT OF NULL VALUES:

Provides basic data access using the ActiveX data objects (ado) object model.
Also provides classes that support data formatting opens a specified database in a
workspace object and returns references to the database object that represents it.

DATABASE:

An object variable that represents the Database objects that we want to open.
3.3.ABOUT WINDOWS’ 2000

Windows 2000 are based on the NT architecture originally initiated as


Windows NT 5.0., this product has emerged as a complete improvement of
Windows NT version 4.0 bringing out the best of all the three-windows’98
and windows’95.A window 2000 is a family of four products of which one
is a client and the other three are servers.
Client:
Windows 2000 professional
Servers:
Windows 2000 server
Windows 2000 Advanced server
Windows 2000 Data center server
Windows 2000 Professional:
Widely named as windows 2000 porches version replaces the NT
workstation 4.0 of the family. The original name of windows 2000 pro was
Windows NT workstation 5.0. Microsoft has integrated its desktop and
networking operating system has made a major decision of launching a
single product that will serve both these purposes. So from now onward
there will be no windows’95 or windows’98 but only window’s 2000.It is
expected to be used as client software to the window 2000 server and also a
desktop operating system. But it is not meant for consumer because
microsoft is planning to release its consumer version of windows in a
different architecture not on the NT kernel.
Windows 2000 server:
Ideally meant to server the small and medium sized enterprises this
version is expected to be the most popular server version. This version was
originally named as Windows NT server 5.0.It can functioned as a worker
server, file and print server, and web server or as domain controller for small
and medium sized organization. It supports two way Symmetric Multi
Processing(SMP).
Windows 2000 advanced server:
The advanced server of windows 2000 family replaces the Windows NT
server 4.0.enterprise edition of NT family and hence was originally named
as Windows NT server 5.0 enterprise editions. It contains all feature of the
advanced server version and as the name suggests is specially designed to
server as database centric server. Its target is handling large data warehouses
and hence includes functionality like data stores, data mining and so on
projects involving data warehouses, large-scale simulations. Online
transaction processing sixteen way Symmetric Multi Processing (SMP)
Features of windows 2000 professional:
Windows 2000 professional is an operating system that contains the best
of windows’95,windows’98 and Windows NT workshop, NT workstation
4.0.The features that differentiate it from other windows operating system
can be best understood exploring the advantages of using windows 2000 as
cited by Microsoft.
1. Easy to Use
2. Reliability
3. Direct Internet Support
4. Enhanced File Management
5. Simplified Management
4. program specification :

“HERBAL MANAGEMENT SYSTEM” begins with login form. Which


is used to restrict the users in to the system.

When the authorized user enters into the system the main form appears.
In the main form there are 3 menus,

1. Master
2. Transaction
3. Report
Master:
It includes the details

1. Herbal
2. Agencies
3. Hospital
4. Sales Man

1. Herbal

This form consists of the fields like Herbal Id, Herbal Name, Manufacuring date, Expriy
Date, Quantity, price, Total. In this form to herbal id number is automatically generated. We
have to enter the all the Fields of the Herbal.

2.Agencies

In this form the fields used are Agencies id, Agencies name, TNGST No, DL No, Address,
City , Phone no City is maintained. The Agencies id is automatically generated
TRANSACTION

It includes the Details like,


1. Customer
2. Sales
1.Agency
2. Hospital
3. Bill Preparation

1. Purchase:

In this form we maintained customer id, customer name, Address, City , Phone no
are maintained . The customer id is automatically generated

1. Sales:

In this form we maintained Sales id, Product id, Customer id, quantity,
Date Of sales, Mode of Payment( Cash/ Credit), Rate, Total etc., are maintained.
Quantity of Product is automatically updated in product stock. Amount is
Automatically updated while we sales the product in credit.

2. Bill Preparation:
In this form we maintained Bill No, Bill Date, Customer id , Customer
Name , Product name, Product Price ,Quantity, rate , total maintained.

REPORT
It includes the reports like
1. Customer
2. Stock
3. Herbal
4. Sales
5. SalesMan

1. Customer Report:

In this Report, all the Customer Details are shown here.


2. Stock Report:

In this Report, all the Dealer Details are shown here.


3. Herbal Report:

In this Report, all the Purchase Details of particular date are


Displayed by selecting the date.
4. Sales Report:

In this Report, all the Sales Details of particular date are


Displayed by selecting the date.
5. Sales man Report
In this report all the sales man details of particulaar dare are
displayed by selecting the date
The developed system has many possibilities for the future

enhancements. It is not possible to this software in the broad concern. This is only

for the limited sections. But in the following days it will be further developed and

that will satisfy our requirements in any point of view. We also improve this

project in other new software for easy use.

FLEXIBILITY OF THE DEVELOPED S/W :

 The developed s/w for and concern is a flexible one. It can be made to run

on the higher version. It can also be made to run on all kinds of platforms.

 Manipulation can be done in the developed s/w without changing the

database, whenever needed. This is an important print, while noting down

the flexibility of the developed s/w.


CONCLUSION

The “HERBAL MANAGEMENT” is flexible, easy to handle and


process. The maintenance can be found easily than by manual processing. All the
operations in this project are handled with simple mouse-click movements.
By use of this software the overhead of the manual processing is
reduced and it provide the automation of sales. Through this we can handle the
transactions very easily.
This system has been thoroughly tested and found to be error free
and it is highly portable. It can easily implemented. It also has a wide scope for the
future developments.
Herbal Details

Sno FieldNane Datatype


1 Herbalid Number
2 Herbal name Text
3 Mfgdate Date/time
4 Expdate Date/time
5 Quantity Number
6. Price Number
7 Total Number

Agencies Details

Sno FieldName Datatype


1 Agenciesid Number
2 Agentname Text
3 Tngstno Number
4 Dlno Number
5 Address Text
6 City Text
7 Phone no number

Customer Details

Sno FieldName Datatype


1 Customerid Number
2 Customername Text
3 Address Text
4 City Text
5 Phone no Number
Hospital Details

Sno FieldName Datatype


1 Hospital name Text
2 Tngstnno Number
3 Dllno Number
4 Address text
5 City Text
6 Phone no Number

Sales Details
Sno FieldName Datatype
1 Sales id Number
2 Productid Number
3 Productname Text
4 Customerid Number
5 Price number
6 Quantiyt Number
7 Totalamount Number

Salesman details

Sno FieldName Datatype


1 Salesman id Number
2 Salesman name Text
3 Address Text
4 City Text
5 Phone no Number
6 Emailid Text
7 Date of joining Date/time
8 Gender text
Bill details

Sno FieldName Datatype


1 Billno Number
2 Bill name Text
3 Customerid Number
4 Customername Text
5 Productid Number
6 Productname Text
7 Quantity Number
8 Price Number
9 Total Number
HERBAL MANGAEMET

MASTER TRANSACTION REPORT


MASTER

HERBAL
AGENCIES HOSPTIAL SALES MAN

TRANSACTION

CUSTOMER SALES BILLPREPARATION

AGENCIES HOSPITAL
LOGIN FORM

Dim con As New ADODB.Connection


Dim rs As New ADODB.Recordset
Dim sql As String
Private Sub Form_Load()
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path
& "\Herbal.mdb;Persist Security Info=False"
End Sub
Private Sub Command1_Click()
con.Open
sql = "select * from login where uid='" & Text1.Text & "' and pwd='" & Text2.Text & "'"
rs.Open sql, con, adOpenDynamic, adLockOptimistic
If rs.EOF = True Then
MsgBox "Login failed! Try again"
Else
Me.Hide
frmSplash.Show
End If
con.Close
End Sub
Private Sub Timer1_Timer()

End Sub

MAIN FORM

Private Sub Age_Click()


Agencies.Show
End Sub

Private Sub agent_Click()


Agencies.Show
End Sub

Private Sub Bill_Click()


Bill1.Show
End Sub

Private Sub Cus_Click()


Customer.Show
End Sub

Private Sub customers_Click()


Customer.Show
End Sub

Private Sub exmnu_Click()


End
End Sub

Private Sub Her_Click()


Herbal.Show
End Sub

Private Sub herbo_Click()


Herbal.Show
End Sub

Private Sub Hos_Click()


Hospital.Show
End Sub

Private Sub Hospitals_Click()


Hospital.Show
End Sub

Private Sub MDIForm_Load()

End Sub

Private Sub sal_Click()


Sales1.Show
End Sub

Private Sub sale_Click()


Salesman.Show
End Sub

Private Sub sales_Click()


Salesman.Show
End Sub

Private Sub Stock_Click()


Purchase.Show
End Sub

AGENCES FORM
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim sql As String
Dim aid As Integer
Private Sub Command1_Click()
Set rs1 = con.Execute("select count (agentid) from agencie")
If (rs1.Fields(0) = 0) Then
Text1.Text = 1
Else
Set rs1 = con.Execute("select max(agentid) from agencie")
Text1.Text = rs1.Fields(0) + 1
End If
Call clrfun
Text1.SetFocus
rs.AddNew
End Sub

Private Sub Command10_Click()


End
End Sub

Private Sub Command2_Click()


aid = InputBox("Enter the agent id")
rs.MoveFirst
rs.Find "agentid=" & aid
If rs.EOF = True Then
MsgBox "Agent not found"
Else
rs.Delete
MsgBox "Removed successfully!"
Call clrfun
End If
End Sub

Private Sub Command3_Click()


If Command3.Caption = "EDIT" Then
Command3.Caption = "UPDATE"
aid = InputBox("Enter the agent id")
rs.MoveFirst
rs.Find "agentid=" & aid
If rs.EOF = True Then
MsgBox "Agent id dosn't found"
Else
Call disp
End If
Else
Command3.Caption = "EDIT"
If rs.EditMode Then
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs(6) = Text7.Text
rs.Save
End If
End If
End Sub

Private Sub Command4_Click()


rs.Fields(0) = Text1.Text
rs.Fields(1) = Text2.Text
rs.Fields(2) = Text3.Text
rs.Fields(3) = Text4.Text
rs.Fields(4) = Text5.Text
rs.Fields(5) = Text6.Text
rs.Fields(6) = Text7.Text
rs.Update
MsgBox "Agent details updated successfully"
End Sub
Private Sub Command6_Click()
rs.MoveFirst
Call disp
End Sub

Private Sub Command7_Click()


rs.MovePrevious
If rs.BOF Then
rs.MoveFirst
MsgBox "This is First Record"
End If
Call disp
End Sub

Private Sub Command8_Click()


rs.MoveNext
If rs.EOF Then
rs.MoveLast
MsgBox "This is Last record"
End If
Call disp
End Sub

Private Sub Command9_Click()


rs.MoveLast
Call disp
End Sub

Private Sub Form_Load()


con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path
& "\Herbal.mdb;Persist Security Info=False"
con.Open
rs.Open "agencie", con, adOpenDynamic, adLockOptimistic
End Sub

Sub clrfun()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Mask = ""
End Sub

Sub disp()
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Text4.Text = rs(3)
Text5.Text = rs(4)
Text6.Text = rs(5)
Text7.Mask = rs(6)
End Sub

CUSTOMER FORM

Dim con As New ADODB.Connection


Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim sql As String
Dim customerid As Integer
Private Sub Command1_Click()
Set rs1 = con.Execute("select count (customerid) from customerdetails")
If (rs1.Fields(0) = 0) Then
Text1.Text = 1
Else
Set rs1 = con.Execute("select max(customerid) from customerdetails")
Text1.Text = rs1.Fields(0) + 1
End If
Call clrfun
Text1.SetFocus
rs.AddNew
End Sub
Private Sub Command10_Click()
End
End Sub
Private Sub Command2_Click()
customerid = InputBox("enter the customerid")
rs.MoveFirst
rs.Find "customerid=" & customerid
If rs.EOF = True Then
MsgBox "Customerid Not found"
Else
rs.Delete
MsgBox "Remove Successfully"
Call clrfun
End If
End Sub
Private Sub Command3_Click()
If Command3.Caption = "EDIT" Then
Command3.Caption = "update"
customerid = InputBox("enter customer id")
rs.MoveFirst
rs.Find "customerid=" & customerid
If rs.EOF = True Then
MsgBox "customer id dosn't found"
Else
Call disp
End If
Else
Command3.Caption = "EDIT"
If rs.EditMode Then
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs.Save
End If
End If
End Sub
Private Sub Command4_Click()
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs.Update
MsgBox "Customer details updated successfully"
End Sub
Private Sub Command6_Click()
rs.MoveFirst
Call disp
End Sub
Private Sub Command7_Click()
rs.MovePrevious
If rs.BOF Then
rs.MoveFirst
MsgBox "This s first record"
End If
Call disp
End Sub
Private Sub Command8_Click()
rs.MoveNext
If rs.EOF Then
rs.MoveLast
MsgBox "this is last record"
End If
Call disp
End Sub
Private Sub Command9_Click()
rs.MoveLast
Call disp
End Sub
Private Sub Form_Load()
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path
& "\Herbal.mdb;Persist Security Info=False"
con.Open
rs.Open "Customerdetails", con, adOpenDynamic, adLockOptimistic
End Sub
Sub clrfun()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
Sub disp()
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Text4.Text = rs(3)
Text5.Text = rs(4)
End Sub

PURCHASE FORM

Dim con As New ADODB.Connection


Dim rs As New ADODB.Recordset
Dim sql As String
Dim productid As Integer
Private Sub Command1_Click()
Set rs1 = con.Execute("select count (productid) from stockentry")
If (rs1.Fields(0) = 0) Then
Text1.Text = 1
Else
Set rs1 = con.Execute("select max(productid) from stockentry")
Text1.Text = rs1.Fields(0) + 1
End If
Call clrfun
Text1.SetFocus
rs.AddNew
End Sub

Private Sub Command10_Click()


DataEnvironment1.Command2 (Text1.Text)
DataReport2.Show
End Sub

Private Sub Command2_Click()


rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs(6) = Text7.Text
rs.Update
MsgBox " Stock Entry details updated successfully"
End Sub

Private Sub Command3_Click()


If Command3.Caption = "EDIT" Then
Command3.Caption = "update"
productid = InputBox("enter product id")
rs.MoveFirst
rs.Find "productid=" & productid
If rs.EOF = True Then
MsgBox "product id dosn't found"
Else
Call disp
End If
Else
Command3.Caption = "EDIT"
If rs.EditMode Then
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs(6) = Text7.Text
rs.Save
End If
End If
End Sub

Private Sub Command4_Click()


productid = InputBox("enter the productid")
rs.MoveFirst
rs.Find "productid=" & productid
If rs.EOF = True Then
MsgBox "Product Not found"
Else
rs.Delete
MsgBox "Remove Successfully"
Call clrfun
End If
End Sub
Private Sub Command5_Click()
End
End Sub
Private Sub Command6_Click()
rs.MoveFirst
Call disp
End Sub
Private Sub Command7_Click()
rs.MovePrevious
If rs.BOF Then
rs.MoveFirst
MsgBox "This s first record"
End If
Call disp
End Sub
Private Sub Command8_Click()
rs.MoveNext
If rs.EOF Then
rs.MoveLast
MsgBox "this is last record"
End If
Call disp
End Sub
Private Sub Command9_Click()
rs.MoveLast
Call disp
End Sub
Private Sub Form_Load()
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path
& "\Herbal.mdb;Persist Security Info=False"
con.Open
rs.Open "stockentry", con, adOpenDynamic, adLockOptimistic
End Sub
Sub clrfun()
Text3.Text = ""
Text4.Text = ""
Text7.Text = ""
End Sub
Sub disp()
Text1.Text = rs(0)
DTPicker1.Value = rs(1)
Text3.Text = rs(2)
Text4.Text = rs(3)
DTPicker2.Value = rs(4)
DTPicker3.Value = rs(5)
Text7.Text = rs(6)
End Sub
Private Sub Text4_LostFocus()
On Error Resume Next
Text8.Text = Text4.Text * Text7.Text
End Sub

SALES FORM

Dim con As New ADODB.Connection


Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim sql As String
Dim salesid As Integer
Dim qty As Integer

Private Sub Combo1_Click()


sql = "select * from stockentry where productid=" & Combo1.Text
rs1.Open sql, con, adOpenDynamic, adLockOptimistic
Text3.Text = rs1(2)
Text6.Text = rs1(3)
rs1.Close
End Sub
Private Sub Command1_Click()
Set rs1 = con.Execute("select count (salesid) from sales")
If (rs1.Fields(0) = 0) Then
Text1.Text = 1
Else
Set rs1 = con.Execute("select max(salesid) from sales")
Text1.Text = rs1.Fields(0) + 1
End If
Call clrfun
Text1.SetFocus
rs.AddNew
End Sub

Private Sub Command2_Click()


rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs.Update
MsgBox "sales details updated successfully"
End Sub

Private Sub Command3_Click()


If Command3.Caption = "EDIT" Then
Command3.Caption = "UPDATE"
customerid = InputBox("enter sales id")
rs.MoveFirst
rs.Find "salesid=" & salesid
If rs.EOF = True Then
MsgBox "sales id dosn't found"
Else
Call disp
End If
Else
Command3.Caption = "EDIT"
If rs.EditMode Then
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs.Save
End If
End If
End Sub

Private Sub Command4_Click()


salesid = InputBox("enter the salesid")
rs.MoveFirst
rs.Find "salesid=" & salesid
If rs.EOF = True Then
MsgBox "salesid Not found"
Else
rs.Delete
MsgBox "Remove Successfully"
Call clrfun
End If
End Sub

Private Sub Command5_Click()


End
End Sub

Private Sub Command6_Click()


rs.MoveFirst
Call disp
End Sub
Private Sub Command7_Click()
rs.MovePrevious
If rs.BOF Then
rs.MoveFirst
MsgBox "This s first record"
End If
Call disp
End Sub
Private Sub Command8_Click()
rs.MoveNext
If rs.EOF Then
rs.MoveLast
MsgBox "this is last record"
End If
Call disp
End Sub
Private Sub Command9_Click()
rs.MoveLast
Call disp
End Sub

Private Sub Form_Load()


con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path
& "\Herbal.mdb;Persist Security Info=False"
con.Open
rs.Open "stockentry", con, adOpenDynamic, adLockOptimistic
While Not rs.EOF
Combo1.AddItem (rs(0))
rs.MoveNext
Wend
End Sub

Sub clrfun()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Sub disp()
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Text4.Text = rs(3)
Text5.Text = rs(4)
Text6.Text = rs(5)
End Sub
Private Sub Text5_LostFocus()
Text2.Text = Val(Text5.Text) * Val(Text6.Text)
End Sub

Private Sub Text6_LostFocus()


rs1.Open "select * From stockentry where productid=" & Combo1.Text, con,
adOpenDynamic, adLockOptimistic
qty = rs1(3)
If qty < Text6.Text Then
MsgBox "Available stock is: " & qty
End If
rs1.Close
End Sub

BILL FORM

Dim con As New ADODB.Connection


Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Dim sql As String
Dim cuid As Integer

Private Sub Combo1_Click()


sql = "select * from customerdetails where customerid=" & Combo1.Text
rs1.Open sql, con, adOpenDynamic, adLockOptimistic
Text6.Text = rs1(1)
rs1.Close
End Sub

Private Sub Combo3_Click()


sql = "select * from stockentry where productid=" & Combo3.Text
rs2.Open sql, con, adOpenDynamic, adLockOptimistic
Text7.Text = rs2(2)
rs2.Close
End Sub

Private Sub Command1_Click()


Call clrfun
Text1.SetFocus
rs.AddNew
End Sub
Private Sub Command2_Click()
rs(0) = Text1.Text
rs(1) = DTPicker1.Value
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs(6) = Combo1.List
rs(7) = Combo2.List
rs(8) = Combo3.List
rs.Update
MsgBox "Customer details updated successfully"
End Sub
Private Sub Command3_Click()
If Command3.Caption = "EDIT" Then
Command3.Caption = "update"
customerid = InputBox("enter customer id")
rs.MoveFirst
rs.Find "customerid=" & customerid
If rs.EOF = True Then
MsgBox "customer id dosn't found"
Else
Call disp
End If
Else
Command3.Caption = "EDIT"
If rs.EditMode Then
rs(0) = Text1.Text
rs(1) = DTPicker1.Value
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs(6) = Text7.Text
rs(7) = Text8.Text
rs(8) = Text9.Text
rs.Save
End If
End If
End Sub
Private Sub Command4_Click()
customerid = InputBox("enter the customerid")
rs.MoveFirst
rs.Find "customerid=" & customerid
If rs.EOF = True Then
MsgBox "Customer Not found"
Else
rs.Delete
MsgBox "Remove Successfully"
Call clrfun
End If
End Sub
Private Sub Command5_Click()
End
End Sub
Private Sub Command6_Click()
rs.MoveFirst
Call disp
End Sub
Private Sub Command7_Click()
rs.MovePrevious
If rs.BOF Then
rs.MoveFirst
MsgBox "This s first record"
End If
Call disp
End Sub
Private Sub Command8_Click()
rs.MoveNext
If rs.EOF Then
rs.MoveLast
MsgBox "this is last record"
End If
Call disp
End Sub
Private Sub Command9_Click()
rs.MoveFirst
Call disp
End Sub
Private Sub Form_Load()
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path
& "\Herbal.mdb;Persist Security Info=False"
con.Open
rs.Open "Customerdetails", con, adOpenDynamic, adLockOptimistic
rs3.Open "stockentry", con, adOpenDynamic, adLockOptimistic
While Not rs.EOF
Combo1.AddItem (rs(0))
rs.MoveNext
Wend
While Not rs3.EOF
Combo3.AddItem (rs3(0))
rs3.MoveNext
Wend
End Sub
Sub clrfun()
Text1.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
Sub disp()
Text1.Text = rs(0)
DTPicker1.Value = rs(1)
Text3.Text = rs(2)
Text4.Text = rs(3)
Text5.Text = rs(4)
Text6.Text = rs(5)
Text7.Text = rs(6)
End Sub

Private Sub Text4_LostFocus()


Text5.Text = Val(Text3.Text) * Val(Text4.Text)
End Sub

SALES MAN FORM

Dim con As New ADODB.Connection


Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim sql As String
Dim sid As Integer
Private Sub Command1_Click()
Set rs1 = con.Execute("select count (salesmanid) from salesman")
If (rs1.Fields(0) = 0) Then
Text1.Text = 1
Else
Set rs1 = con.Execute("select max(salesmanid) from salesman")
Text1.Text = rs1.Fields(0) + 1
End If
Call clrfun
Text1.SetFocus
rs.AddNew
End Sub
Private Sub Command10_Click()
rs.MoveLast
Call disp
End Sub
Private Sub Command2_Click()
rs.Fields(0) = Text1.Text
rs.Fields(1) = Text2.Text
rs.Fields(2) = Text3.Text
rs.Fields(3) = Text4.Text
rs.Fields(4) = Text5.Text
rs.Fields(5) = Text6.Text
rs.Fields(6) = Text7.Text
rs.Update
MsgBox "detail are update"
End Sub
Private Sub Command3_Click()
sid = InputBox("enter the employeeid")
rs.MoveFirst
rs.Find "Employeeid=" & sid
If rs.EOF = True Then
MsgBox "employee id doesn't found"
Else
Call disp
End If
End Sub

Private Sub Command4_Click()


sid = InputBox("Enter Raw meterial ID")
rs.MoveFirst
rs.Find "Employeeid=" & sid
If rs.EOF = True Then
MsgBox "salesman id not found"
Else
Call disp
End If
End Sub
Private Sub Command5_Click()
sid = InputBox("enter the employee id")
rs.MoveFirst
rs.Find "employeeid=" & sid
If rs.EOF = True Then
MsgBox "employee id not foundd"
Else
rs.Delete
MsgBox "removed successfully"
Call clrfun
End If
End Sub
Private Sub Command6_Click()
End
End Sub
Private Sub Command7_Click()
rs.MoveFirst
Call disp
End Sub
Private Sub Command8_Click()
rs.MovePrevious
If rs.BOF = True Then
rs.MoveFirst
MsgBox "this is first record"
End If
Call disp
End Sub
Private Sub Command9_Click()
rs.MoveNext
Call disp
End Sub

Private Sub Form_Load()


con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path
& "\Herbal.mdb;Persist Security Info=False"
con.Open
rs.Open "salesman", con, adOpenDynamic, adLockOptimistic
End Sub
Sub clrfun()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Sub disp()
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Text4.Text = rs(3)
Text5.Text = rs(4)
Text6.Text = rs(5)
DTPicker1.Value = rs(6)
End Sub

HOSPITAL FORM

Dim con As New ADODB.Connection


Dim rs As New ADODB.Recordset
Dim sql As String
Dim hospitalname As String
Private Sub Command11_Click()
Call clrfun
Text1.SetFocus
rs.AddNew
End Sub
Private Sub Form_Load()
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path
& "\Herbal.mdb;Persist Security Info=False"
con.Open
rs.Open "hospital", con, adOpenDynamic, adLockOptimistic
End Sub
Private Sub Command10_Click()
End
End Sub

Private Sub Command2_Click()


aid = InputBox("Enter the hospital name")
rs.MoveFirst
rs.Find "hospital=" & hosname
If rs.EOF = True Then
MsgBox "hospital name not found"
Else
rs.Delete
MsgBox "Removed successfully!"
Call clrfun
End If
End Sub

Private Sub Command3_Click()


If Command3.Caption = "EDIT" Then
Command3.Caption = "UPDATE"
aid = InputBox("Enter the hospital name")
rs.MoveFirst
rs.Find "hospital=" & hosname
If rs.EOF = True Then
MsgBox "hospital name dosn't found"
Else
Call disp
End If
Else
Command3.Caption = "EDIT"
If rs.EditMode Then
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs.Save
End If
End If
End Sub

Private Sub Command4_Click()


rs.Fields(0) = Text1.Text
rs.Fields(1) = Text2.Text
rs.Fields(2) = Text3.Text
rs.Fields(3) = Text4.Text
rs.Fields(4) = Text5.Text
rs.Fields(5) = Text6.Text
rs.Update
MsgBox "Hospital name updated successfully"
End Sub
Private Sub Command6_Click()
rs.MoveFirst
Call disp
End Sub

Private Sub Command7_Click()


rs.MovePrevious
If rs.BOF Then
rs.MoveFirst
MsgBox "This is First Record"
End If
Call disp
End Sub

Private Sub Command8_Click()


rs.MoveNext
If rs.EOF Then
rs.MoveLast
MsgBox "This is Last record"
End If
Call disp
End Sub
Private Sub Command9_Click()
rs.MoveLast
Call disp
End Sub
Sub clrfun()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub

Sub disp()
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Text4.Text = rs(3)
Text5.Text = rs(4)
Text6.Text = rs(5)

End Sub

HERBAL FORM

Dim con As New ADODB.Connection


Dim rs As New ADODB.Recordset
Dim sql As String
Dim herblaid As Integer
Private Sub Command1_Click()
Set rs1 = con.Execute("select count (herbalid) from herbal")
If (rs1.Fields(0) = 0) Then
Text1.Text = 1
Else
Set rs1 = con.Execute("select max(herbalid) from herbal")
Text1.Text = rs1.Fields(0) + 1
End If
Call clrfun
Text1.SetFocus
rs.AddNew
End Sub

Private Sub Command10_Click()


End
End Sub

Private Sub Command2_Click()


aid = InputBox("Enter the herbalid")
rs.MoveFirst
rs.Find "herbal=" & herbalid
If rs.EOF = True Then
MsgBox "herbalid not found"
Else
rs.Delete
MsgBox "Removed successfully!"
Call clrfun
End If
End Sub

Private Sub Command3_Click()


If Command3.Caption = "EDIT" Then
Command3.Caption = "UPDATE"
aid = InputBox("Enter the herbalid")
rs.MoveFirst
rs.Find "herbal=" & herbalid
If rs.EOF = True Then
MsgBox "herbalid dosn't found"
Else
Call disp
End If
Else
Command3.Caption = "EDIT"
If rs.EditMode Then
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs(3) = Text4.Text
rs(4) = Text5.Text
rs(5) = Text6.Text
rs(6) = Text7.Text
rs.Save
End If
End If
End Sub

Private Sub Command4_Click()


rs.Fields(0) = Text1.Text
rs.Fields(1) = Text2.Text
rs.Fields(2) = Text3.Text
rs.Fields(3) = Text4.Text
rs.Fields(4) = Text5.Text
rs.Fields(5) = Text6.Text
rs.Fields(6) = Text7.Text
rs.Update
MsgBox "Herbal details updated successfully"
End Sub
Private Sub Command6_Click()
rs.MoveFirst
Call disp
End Sub

Private Sub Command7_Click()


rs.MovePrevious
If rs.BOF Then
rs.MoveFirst
MsgBox "This is First Record"
End If
Call disp
End Sub

Private Sub Command8_Click()


rs.MoveNext
If rs.EOF Then
rs.MoveLast
MsgBox "This is Last record"
End If
Call disp
End Sub

Private Sub Command9_Click()


rs.MoveLast
Call disp
End Sub

Private Sub Form_Load()


con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path
& "\Herbal.mdb;Persist Security Info=False"
con.Open
rs.Open "herbal", con, adOpenDynamic, adLockOptimistic
End Sub

Sub clrfun()
Text2.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub

Sub disp()
Text1.Text = rs(0)
Text2.Text = rs(1)
DTPicker1.Value = rs(2)
DTPicker1.Value = rs(3)
Text5.Text = rs(4)
Text6.Text = rs(5)
Text7.Text = rs(6)
End Sub
Private Sub Text6_LostFocus()
Text7.Text = Val(Text5.Text) + Val(Text6.Text)
End Sub
Login Form
Main Form
AGENCIES FORM
CUSTOMER FORM
PURCHASE FORM
SALES PREPARATION
BILL PREPARATION
SALES MAN FORM
HOSPITAL DETAILS
DataReport1
Data Report2
BIBLIOGRAPHY
BIBLIOGRAPHY

1. Visual Basic 6.0 : The complete Reference – NOVEL YERKS

TATA McGraw - Hill D Edition – 1999

2. Visual Basic 6.0 - The user Manual.

3. Visual Basic Programming - Ventana

Comdex Publishers

You might also like