e raion card

178
A Project Report On E-Ration Card System Submitted in partial fulfillment of the requirement for the award of degree Bachelor of Computer Application From Pt. RaviShankar Shukla University Raipur (C.G) Year: 2014 Submitted to Guide Mrs Shikha Tamrakar Submitted By: Mayank Gupta Roll No:

Upload: pritam-sondhiya

Post on 09-Nov-2015

227 views

Category:

Documents


4 download

DESCRIPTION

A project report on E ration card management system

TRANSCRIPT

AProject ReportOnE-Ration Card SystemSubmitted in partial fulfillment of the requirement for the award of degreeBachelor of Computer ApplicationFromPt. RaviShankar Shukla University Raipur (C.G)Year: 2014

GuideMrs Shikha TamrakarSubmitted By:Mayank GuptaRoll No:

Submitted toCentury Cement College,BaikunthPt.RaviShankar Shukla University Raipur (C.G)CERTIFICATE OF APPROVALThis is to certify that the Project work entitled E-Ration Card System is carried out by Mr Mayank Gupta a student of BCA-III year at Century Cement College is hereby approved as a credible in the discipline of Computer Science & Information Techology for the award OF the degree of Bachelor Of Computer Application during the year 2013-2014 from Pt. Ravishankar Shukla University,Raipur(C.G).

CERTIFICATEThis is to certify that the Project entitled E-Ration Card System Submitted to the Century Cement College Baikunth by Mr. Mayank Gupta Roll No in partial fulfillment for the requirementrelating to nature and standard of the of Bachelor Of Computer ApplicationDegree by Pt. Ravishankar Shukla University,Raipur (CG) for the academic year2013-2014.

The project work has been carried out under my guidance.Mrs. Shikha Tamrakar

CERTIFICATE OF EVALUTIONThis is to certify that the Project work entitled E-Ration Card System is carried out by Mr. Mayank Gupta a Student of BCA-III year of Century Cement College, after proper evalution and examination, is hereby approved as a credible work in the discipline of Comaputer Science and Information Technology and is done in satisfactory manner for its acceptance as a requisite for the award of degree of Bachelor Of Computer Application during the year 2013-2014 from Pt. Ravishankar Shukla University,Raipur (C.G).

Internal Examiner External Examiner

DECLARATIONThis is certify that tha Project work entitled E-Ration Card System which is submitted by me in the partial fulfillment for the award of the degree of Bachelor of Computer Application, Century Cement College,Baikunth comprises the original work carried out by me.I further declare that the work reported in this project has not been submitted and will no be submitted, either in part or infill for the award of any other degree or diploma in this Institute or any other Institute or University.

Place :Mayank GuptaDate :..Roll No.....

IndexIntroductionObjectiveExisting systemProblem DefinitionRequirement analysisSystem analysisH/W and S/W requirementDatabase DesignE-R DiagramData Flow DiagramInput DesignOutput DesignTestingConclusionReferences

IntroductionE-Ration Card System is complete end to end Online solution to cover all aspects of Ration Card System day to day activity and Record of Each Record selling procedure for system.

As the name specifies E-Ration System is a online System developed for managing various activities in the Ration Card Department. For the past few this system are developed and uses increasing rapidly. Thereby the numbers of Consumer card Shop are also increasing for the accommodation of the people of city or village. And hence there is a lot of strain on the person in this system who are manually works on it and softwares are not usually used in this context. This particular project deals with the problems on managing all main aspects and avoids the problems which occur when carried manually. Identification of the drawbacks of the existing system leads to the designing of online system that will be compatible to the existing system with the system which is more user friendly and more GUI oriented. We can improve the efficiency of the system, thus overcome the drawbacks of the existing system.

Objective1) This Online system to improve their services for all the Consumer Supplier Retailer and also for the person of the admin department. 2) This also reduce the manual work of the persons in admin penal and the bundle of registers that were search when to find the information for other record to manage, because through this system you can store the data of those Consumer card shop product allocations of product and card to the Consumer.3) Through this one can check the personal profile of their and get information within few minutes the data base of the system will help you to check a particular details 4) The system will help you to check validation of card while selling the product to that consumer. And provide easy way to sell product with less entry5) Supplier have not to wait for the shops Sales Details This system automatically manage the stock of product using the record in database.6) All user Admin, Supplier, Retailer can get details they want7) Any record will be recognized from the ID number allocated to them. In the last this online system will improve the management work related to Ration Card System.

Existing System Existing system is based on manual work and all the process are done manually, so they maintain registers and files for recording all the details of the system. The shop Retailer maintain several registers for recording the entry of daily sales List of card valid or Not etc. The Supplier maintain several registers for recording the monthly Supplies and details of Sales of Each shop And qty of product to be Supplied Administration department maintain lot of record about all like shops card retailer suppliers etc. They have register for each type record. Thus maintaining all Records such as Consumers Supplier Shop Retailer and changes in any Record Calculation of supplies all work are done Manually.

PROBLEM DEFINITIONThe phase of system analysis process deals with problems that are affecting in the current manual system. The problems are those, which are affecting the organization in it daily routine work.As the growing trend in InfoTech World of computers need of accuracy, perfect ness, speed and high memory data storage is a must. Each and every problem must be solved with a least amount of time and energy.The problems faced by existing system are described as below: Difficulty in Maintenance of Records. Time Consuming. Editing of data becomes a tedious job. Mistakes Occurring in long Calculations [Total Qty, no of card calculations, etc.] Proper Generation of Report (i.e. list of consumer list of Product ,Sales Bills etc.) Lack of Efficiency High Data Redundancy. Data Inconsistency. These are the problems faced during the real time execution of the existing system and this awakened the idea of making a tool which negotiates the above drawbacks in a sophisticated yet in a simple manner. The idea is nonetheless

REQUIREMENT ANALYSISRequirements Analysis is the process of understanding the customer needs and expectations from a proposed system or application and is a well-defined stage in the Software Development Life Cycle model. Requirements are a description of how a system should behave or a description of system properties or attributes. It can alternatively be a statement of what an application is expected to do. Given the multiple levels of interaction between users, business processes and devices in global corporations today, there are simultaneous and complex requirements from a single application, from various levels within an organization and outside it as well. The Software Requirements Analysis Process covers the complex task of eliciting and documenting the requirements of all these users, modeling and analyzing these requirements and documenting them as a basis for system design. Software Requirements Analysis and Documentation Processes are critical to software project success. Requirements engineering is an emerging field which deals with the systematic handling of requirements.

User RequirementsUser requirements are categorized by user type.User Able to search and view his or her own read only information.Supplier Able to access Sales Details of Retailers to make make monthly supply. Generate Bills. View and make various document and letter.System Administrator Add new consumer, supplier product shop Retailer etc. assigns role and privileges. Generate Reports Database backup and maintenance.Retailer Able to access Details . Generate Bills. Sales product to Consumer. Update the Received product.

Operational RequirementsThe following requirements provide a high-level view of how the system will run: A full Monthly backup is required. Application should run in Client-Server architecture..

System RequirementsThis project mainly aims to deal the operations It consists of 2 modules. User module Administrator module Supplier Retailer ADMINSTRATOR MODULE CONSIST OF Admin login Master Block Master Product Master Card Master Consumer Master Supplier Master Retailer and shop Allocation Report

SUPPLIER MODULE CONSIST OF login Master Sales Master search Report

RETAILER MODULE CONSIST OF login Master purchase Master Sales Report and bills Master Sales

SYSTEM REQUIREMENT

Hardware requirement:-This software requires following minimum hardware configuration:Processor: Pentium-VRAM: 512MB Hard Disk: 100 GBCD DriveMonitor-15 Color MonitorKeyboard Mouse Software Requirement:-This software requires following minimum Software configuration:Front End:Microsoft Visual Basic 6.0For fast development, easy to deployment and maintain.Back End:Ms Access 2007

Visual Basic 6.0Visual Basic 6 is built on the Windows Server System to take major advantage of the OS and which comes with a host of different servers which allows for building, deploying, managing and maintaining Windows Based solutions. The Windows Server System is designed with performance as priority and it provides scalability, reliability. VISUAL BASIC is a high level programming language that provides users a powerful graphical interface incorporating a lot of statements, functions, keywords and other features. Besides, a very useful tool of learning programming skills for the novice, the professionals assumes it as a grand platform for software development. This has predefined components and controls. And these components n controls can be direct pasted on the form and the coding is given inside the controls after double clicking on it.It has many features such as it is Object Oriented, Event Driven, Debug Window, Tool Bars, and Templates etc. In Visual Basic, the form is the basic entity that works as a container for all the controls that make up the user interface. When a Visual Basic application is executing, each window it displays is actually a form. Forms have a built-in functionality that is always available without any programming effort on your part.

The advantage of VB 6 includes Rapid Application Development (RAD) Support. Powerful Windows-based Applications Simplified Deployment Powerful, Flexible, Simplified Data Access Improved Coding Direct Access to the OS Platform Object-Oriented Constructs COM Interoperability

MS Access 2007 : -Microsoft Access 2007 is an object-relational database management system (ORDBMS) which obeys all 12 Cods rules.This combines the relational Microsoft Jet Database Engine into Graphical User Interface & Software Development tools. We have used Ms-Access as a back end for our software. All the data are stored in the access in tables in the form of records. The connectivity is provided between the front end (Visual Basic) and the back end (Ms-Access Relational Database).This is a backend tool widely used for personal computer as a database. The relational database is a well defined theoretical model of working with and managing a set of data that attends to three specifying things.- Data structures - Data integrity- Data manipulation.

Block:-

Card:-

Card Allotment

Consumer

Product

Product Allotment

Retailer

Shop

Login

Product supply

Product supplied

Consumer Sales

Con_Product

E-R Diagram

LivesSent toSupplyBlocknocitypcodeaddresssuppcodenameSupplierEntityAttributesRelationshipCardnorCardnoPur/soldUnitmsrpnamepcodeCardsrshopcodeconsumerCardtypeColorCardnameessretcodesaddshopnameShopCodeFathernameretaddressDOBretnameretcodeHoldsBlocknameBlocknoConaddressDOBFathernameCodeConnameSoldProductBelong/saleCardConsumerBlockShopRetailer

HasHas

DATA FLOW DIAGRAM :A data flow diagram is graphical tool used to describe and analyze movement of data through a system. These are the central tool and the basis from which the other components are developed. The transformation of data from input to output, through processed, may be described logically and independently of physical components associated with the system. These are known as the logical data flow diagrams. The physical data flow diagrams show the actual implements and movement of data between people, departments and workstations. A full description of a system actually consists of a set of data flow diagrams. Using two familiar notations Yourdon, Gane and Sarson notation develops the data flow diagrams. Each component in a DFD is labeled with a descriptive name. Process is further identified with a number that will be used for identification purpose. The development of DFDs is done in several levels. Each process in lower level diagrams can be broken down into a more detailed DFD in the next level. The lop-level diagram is often called context diagram. It consists a single process bit, which plays vital role in studying the current system. The process in the context level diagram is exploded into other process at the first level DFD.The idea behind the explosion of a process into more process is that understanding at one level of detail is exploded into greater detail at the next level. This is done until further explosion is necessary and an adequate amount of detail is described for analyst to understand the process. A DFD is also known as a bubble Chart has the purpose of clarifying system requirements and identifying major transformations that will become programs in system design. So it is the starting point of the design to the lowest level of detail. A DFD consists of a series of bubbles joined by data flows in the system.

DFD SYMBOLS :In the DFD, there are four symbols1. A square defines a source(originator) or destination of system data2. An arrow identifies data flow. It is the pipeline through which the information flows3. A circle or a bubble represents a process that transforms incoming data flow into outgoing data flows.4. An open rectangle is a data store, data at rest or a temporary repository of data

Process

Data FlowSource or Destination of data

Data Flow Diagram

E-RationCard systemUSERUSERRequestResponse

Purchase detailsPaymentSales informationAdminSupplierCustomerRetailerCardSale ProductAllotment infoE-Ration Card Management SystemTakes retailer sales recordDetails Card/Customer/Card detailsSupplies Sales detailsContext Diagram

MenuMenuSelectionVerificationLogin

User login

Admin

supplier

Retailer

Supplier

Level 1 DFD Master salesCode ,qty and amtProduct supplyShop CodeShopSupplierRetailerMaster SupplyReceiveSupplyPaymentPaymentProduct

ConsumerBill PaymentMaster SalesRetailerConsumer salesProduct allotmentCard allotmentLevel 2 DFD Consumer SalesConsumer Sales: -

Splash : -

Block : -

Card : -

Menu : -

Master Card : -

Consumer : -

Master Sales : -

Master Supplier : -

Master supply :-

Master Shop : -

Product Master : -

Splash Form

Description

Block Form

Description

Cards

Card Allotment :-

Master Product :-

Master Sales :=

\Consumer

Master Supply

Search : -

Product allotment ;_

Home Page :-

Users Form :-

Block with No of Consumer in Block;-

Supplier List :-

Consumer list ;-

Consumer Details :-

Cards Details :-

SYSTEM TESTING

System testing is the stage of implementation, which is aimed at ensuring that the system works accurately and efficiently before live operation commences. Testing is the process of executing the program with the intent of finding errors and missing operations and also a complete verification to determine whether the objectives are met and the user requirements are satisfied. The ultimate aim is quality assurance. Tests are carried out and the results are compared with the expected document. In the case of erroneous results, debugging is done. Using detailed testing strategies a test plan is carried out on each module. The various tests performed are unit testing, integration testing and user acceptance testing.

Unit Testing

The software units in a system are modules and routines that are assembled and integrated to perform a specific function. Unit testing focuses first on modules, independently of one another, to locate errors. This enables, to detect errors in coding and logic that are contained within each module. This testing includes entering data and ascertaining if the value matches to the type and size supported by java. The various controls are tested to ensure that each performs its action as required.

Integration Testing

Data can be lost across any interface, one module can have an adverse effect on another, sub functions when combined, may not produce the desired major functions. Integration testing is a systematic testing to discover errors associated within the interface. The objective is to take unit tested modules and build a program structure. All the modules are combined and tested as a whole. Here the Server module and Client module options are integrated and tested. This testing provides the assurance that the application is well integrated functional unit with smooth transition of data.

User Acceptance Testing

User acceptance of a system is the key factor for the success of any system. The system under consideration is tested for user acceptance by constantly keeping in touch with the system users at time of developing and making changes whenever required.

Testing Reports1) COMPILATION TEST:It was a good idea to do our stress testing early on, because it gave us time to fix some of the unexpected deadlocks and stability problems that only occurred when components were exposed to very high transaction volumes.

2) EXECUTION TEST:This program was successfully loaded and executed. Because of good programming there was no execution error.

3) OUTPUT TEST:The successful output screens are placed in the output screens section.

Option ExplicitPublic con As New ADODB.ConnectionPublic cmd As New ADODB.CommandPublic rs, rs1 As New ADODB.RecordsetPublic strins, strsel, s As String

Public Sub connectdb()If con.State = 0 Thencon.Open "Provider=Microsoft.ACE.OLEDB.12.0;Persist Security Info=False;Data Source=" & App.Path & "\db\db.accdb "con.CursorLocation = adUseClientEnd IfEnd Sub

Public Sub setdbobject()Set con = New ADODB.ConnectionSet cmd = New ADODB.CommandSet rs = New ADODB.Recordsetconnectdbcmd.ActiveConnection = concmd.CommandType = adCmdTextEnd Sub

Code for block Form: -Private Sub Command1_Click()strins = "INSERT INTO block VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "')"con.Execute (strsel)getblockEnd Sub

Private Sub Command2_Click()If Command4.Visible = True ThencleargetblockEnd IfEnd Sub

Private Sub Command3_Click()setdataCommand7.Visible = TrueCommand1.Visible = FalseEnd Sub

Private Sub Command5_Click()Set drblock.DataSource = rsdrblock.ShowEnd Sub

Private Sub Command6_Click()frmmenu.ShowUnload MeEnd Sub

Private Sub Command7_Click()strins = "UPDATE ((block INNER JOIN consumer ON block.Blockno = consumer.blockno)" & _" INNER JOIN retailer ON block.Blockno = retailer.blockno) " & _" INNER JOIN shop ON (retailer.retcode = shop.retcode) " & _" AND (block.Blockno = shop.blockno) SET block.Blockno = '" & Me.Text1.Text & "'," & _" blockname = '" & Me.Text2.Text & "' " & _" WHERE block.Blockno= '" & Text5.Text & "'"con.Execute (strsel)

strins = "UPDATE (block INNER JOIN consumer ON block.Blockno = consumer.blockno) " & _" INNER JOIN retailer ON block.Blockno = retailer.blockno " & _" SET block.Blockno = '" & Text1.Text & "', " & _" blockname = '" & Me.Text2.Text & "' " & _" WHERE block.Blockno = '" & Text5.Text & "'"con.Execute (strsel)

strins = "UPDATE block INNER JOIN consumer ON block.Blockno = consumer.blockno " & _" SET block.Blockno = '" & Me.Text1.Text & "', " & _" blockname = '" & Me.Text2.Text & "' " & _" WHERE block.Blockno='" & Text5.Text & "'"con.Execute (strsel)

strins = "UPDATE block INNER JOIN retailer ON block.Blockno = retailer.blockno " & _" SET block.Blockno = '" & Me.Text1.Text & "', " & _" blockname = '" & Me.Text2.Text & "' " & _" WHERE block.Blockno='" & Text5.Text & "'"con.Execute (strsel)clearCommand7.Visible = FalseCommand1.Visible = TrueEnd Sub

Private Sub Form_Load()Form1.Showmain.HideMe.Top = 2000Me.Left = 4000 'called to connect to databasesetdbobject 'called to sets database objectgetblock 'called to gets All block to gridCombo1.Text = "----------Select----------"Combo1.AddItem "Block no"Combo1.AddItem "Block Name"Combo1.ListIndex = 0End Sub

Private Sub Label10_Click()If rs.BOF = True ThenElsers.MovePreviousEnd IfEnd Sub

Private Sub Label10_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 1End Sub

Private Sub Label10_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 0End Sub

Private Sub Label11_Click()If rs.EOF = False ThenElsers.MoveNextEnd IfEnd Sub

Private Sub Label11_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label11.BorderStyle = 1End Sub

Private Sub Label11_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label11.BorderStyle = 0End Sub

Private Sub Label12_Click()rs.MoveLastEnd Sub

Private Sub Label12_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label12.BorderStyle = 1End Sub

Private Sub Label12_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label12.BorderStyle = 0End Sub

Private Sub Label9_Click()rs.MoveFirstEnd Sub

Private Sub Label9_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label9.BorderStyle = 1End Sub

Private Sub Label9_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label12.BorderStyle = 0End Sub

Private Sub Text5_Change()searchsetgridEnd Sub

Private Sub getblock()strsel = "SELECT block.*, tc.Total as Consumers " & _"FROM block LEFT JOIN tc ON block.Blockno = tc.Blockno"Set rs = con.Execute(strsel)Set dg.DataSource = rssetgridEnd Sub

Private Sub search()If Combo1.ListIndex = 0 Thens = "SELECT * FROM block WHERE Blockno LIKE '%" & Me.Text5.Text & "%'"ElseIf Combo1.ListIndex = 1 Thens = "SELECT * FROM block WHERE Blockname LIKE '%" & Me.Text5.Text & "%'"End IfSet rs = con.Execute(strsel)Set dg.DataSource = rssetgridEnd Sub

Private Sub setdata()With rsText1.Text = !blocknoText2.Text = !blocknameText5.Text = !blocknoEnd WithCommand4.Visible = TrueCommand1.Visible = FalseEnd Sub

Private Sub setgrid()If rs.BOF = True Or rs.EOF = True ThenElsedg.Columns(0).DataField = rs!blocknodg.Columns(1).DataField = rs!blocknamedg.Columns(0).Width = 1000dg.Columns(1).Width = 2000dg.Columns(0).Caption = "Block No"dg.Columns(1).Caption = "Block Name"End IfEnd Sub Private Sub clear()Text1.Text = ""Text2.Text = ""getblockEnd Sub

Private Sub Timer1_Timer()Label3.ForeColor = vbRedTimer1.Enabled = FalseTimer2.Enabled = TrueEnd Sub

Private Sub Timer2_Timer()Label3.ForeColor = vbBlueTimer1.Enabled = TrueTimer2.Enabled = FalseEnd Sub

Code for consumer Form :=Private Sub Command1_Click()strins = "INSERT INTO consumer VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "', " & _" '" & Me.Text3.Text & "'," & Me.DTPicker1.Value & ", " & _" '" & Me.Text4.Text & "','" & Me.Combo1.Text & "', " & _" ' " & Val(Me.Text7.Text) & " ','" & Me.Text6.Text & "', " & _" '" & Me.Text1.Text & "','" & Me.Combo3.Text & "'," & _" '" & Me.Text9.Text & "','" & s & "'," & _" '" & Me.Combo4.Text & "','" & Me.Text9.Text & "'," & _" '" & Text10.Text & "')"con.Execute (strins)clearEnd Sub

Private Sub Command3_Click()setvalEnd Sub

Private Sub Command6_Click()main.ShowEnd Sub

Private Sub Command7_Click()CommonDialog1.DialogTitle = "Select Image"CommonDialog1.ShowOpenLabel21.Caption = CommonDialog1.FileNames = CommonDialog1.FileTitleImage1.Picture = LoadPicture(CommonDialog1.FileName)FileCopy CStr(Label21.Caption), "" & App.Path & "\dbpic\" & CommonDialog1.FileTitle & ""End Sub

Private Sub Label10_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 1End Sub

Private Sub Label10_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 0End Sub

Private Sub Label11_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label11.BorderStyle = 1End Sub

Private Sub Label11_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label11.BorderStyle = 0End Sub

Private Sub Label12_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label12.BorderStyle = 1End Sub

Private Sub Label12_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label12.BorderStyle = 0End Sub

Private Sub Label13_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label13.BorderStyle = 1End Sub

Private Sub Label13_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label13.BorderStyle = 0End Sub

Private Sub Text5_Change()searchEnd Sub

Private Sub Command2_Click()clearEnd Sub

Private Sub Form_Load()Form1.Showmain.HideUnload mainMe.Top = 1500Me.Left = 1500setdbobjectWith Combo2.Text = "----------Select----------".AddItem "ID".AddItem "Name".AddItem "Block No"End WithWith Combo3.Text = "----Select-----".AddItem "Male".AddItem "Female"End With

With Combo4.Text = "----Select-----".AddItem "Gen".AddItem "OBC".AddItem "ST/SC"End WithCombo2.ListIndex = 0Command4.Visible = FalseclearEnd Sub

Private Sub conlist()strsel = "Select * from consumer"Set rs = con.Execute(strsel)Set dg.DataSource = rssetgridEnd Sub

Private Sub Label10_Click()rs.MoveFirstEnd Sub

Private Sub Label11_Click()rs.MovePreviousEnd Sub

Private Sub Label12_Click()rs.MoveNextEnd Sub

Private Sub Label13_Click()rs.MoveLastEnd Sub

Private Sub clear()Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""dtpicker1value = DateText6.Text = ""Text7.Text = ""Combo1.clearCombo1.Text = "----------Select----------"Combo4.Text = "---Select----"addblockEnd Sub

Private Sub addblock()strsel = "Select * from block"Set rs = con.Execute(strsel)Combo1.clearWhile rs.EOF = FalseCombo1.AddItem rs!blocknors.MoveNextWendconlistEnd Sub

Private Sub search()If Combo2.ListIndex = 0 Thenstrsel = "Select * from Consumer where code like '%" & Text5.Text & "%'"ElseIf Combo2.ListIndex = 1 Thenstrsel = "Select * from Consumer where conname like '%" & Text5.Text & "%'"ElseIf Combo2.ListIndex = 2 Thenstrsel = "Select * from Consumer where blockno like '%" & Text5.Text & "%'"End IfSet rs = con.Execute(strsel)Set dg.DataSource = rssetgridEnd Sub

Private Sub setval()With rsText5.Text = !codeText1.Text = !codeText2.Text = !connameText3.Text = !fathernameText4.Text = !conaddressText6.Text = !housenoText7.Text = !phoneText8.Text = !occupationText9.Text = !annual_salaryText10.Text = !membersdtpicker1value = !dobCombo1.Text = !blocknoCombo3.Text = !genderCombo4.Text = !categorys = rs!pic_path'Image1.Picture = LoadPicture("" & App.Path & "\dbpic\" '" & s & "'.jpg ")End WithEnd Sub

Private Sub setgrid()Dim i As IntegerFor i = o To 6 Step 1dg.Columns(i).DataField = rs.Fields(i)Next idg.Columns(0).Caption = "ID"dg.Columns(0).Width = 1000dg.Columns(1).Caption = "Name"dg.Columns(2).Caption = "Father Name"dg.Columns(3).Caption = "Date Of Birth"dg.Columns(4).Caption = "Address"dg.Columns(5).Caption = "Block No"End Sub

Private Sub Timer1_Timer()Label6.ForeColor = vbRedTimer1.Enabled = FalseTimer2.Enabled = TrueEnd Sub

Private Sub Timer2_Timer()Label6.ForeColor = vbBlueTimer1.Enabled = TrueTimer2.Enabled = fasleEnd Sub

Code for Card :-Private Sub Form_Load()Form1.ShowMe.Top = 2500Me.Left = 3500setdbobjectCombo1.Text = "---------Select---------"Combo1.AddItem "Card No"Combo1.AddItem "Card Name"Combo1.AddItem "Type "Combo1.ListIndex = 0cardlistEnd Sub

Private Sub Command1_Click()strins = "INSERT INTO card VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "','" & Me.Text3.Text & "','" & Me.Text4.Text & "')"con.Execute (strins)clearEnd Sub

Private Sub Command3_Click()With rsText1.Text = !cardsrText2.Text = !cardnameText3.Text = !cardtypeText4.Text = !cardcolorText5.Text = !cardsrCommand4.Visible = TrueCommand1.Visible = FalseEnd WithEnd Sub

Private Sub Command4_Click()strins = "UPDATE (card INNER JOIN Card_allotment ON card.cardsr = Card_allotment.Cardsr) " & _" INNER JOIN product_allotment ON card.cardsr = product_allotment.cardsr " & _" SET card.cardsr = '" & Text1.Text & "', " & _" card.cardname = '" & Text2.Text & "', " & _" card.cardtype = '" & Text3.Text & "', " & _" card.cardcolor = '" & Text4.Text & "' " & _" WHERE card.cardsr='" & Text5.Text & "'"con.Execute (strins)

strins = "UPDATE card INNER JOIN product_allotment ON card.cardsr = product_allotment.cardsr " & _" SET card.cardsr = '" & Text1.Text & "', " & _" card.cardname = '" & Text2.Text & "', " & _" card.cardtype = '" & Text3.Text & "', " & _" card.cardcolor = '" & Text4.Text & "' " & _" WHERE card.cardsr='" & Text5.Text & "'"con.Execute (strins)

strins = "UPDATE card INNER JOIN card_allotment ON card.cardsr = card_allotment.cardsr " & _" SET card.cardsr = '" & Text1.Text & "', " & _" card.cardname = '" & Text2.Text & "', " & _" card.cardtype = '" & Text3.Text & "', " & _" card.cardcolor = '" & Text4.Text & "' " & _" WHERE card.cardsr='" & Text5.Text & "'"con.Execute (strins)

clearCommand4.Visible = FalseCommand1.Visible = TrueEnd Sub

Private Sub Text5_Change()searchEnd Sub

Private Sub Command5_Click()Set drcard.DataSource = rsdrcard.ShowEnd Sub

Private Sub Command6_Click()frmmenu.ShowUnload MeEnd Sub

Private Sub Label9_Click()rs.MoveFirstEnd Sub

Private Sub Label9_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 1End Sub

Private Sub Label9_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 0End Sub

Private Sub Label10_Click()rs.MovePreviousEnd Sub

Private Sub Label10_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 1End Sub

Private Sub Label10_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 0End Sub

Private Sub Label11_Click()rs.MoveNextEnd Sub

Private Sub Label11_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label11.BorderStyle = 1End Sub

Private Sub Label11_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label11.BorderStyle = 0End Sub

Private Sub Label12_Click()rs.MoveNextEnd Sub

Private Sub Label12_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label12.BorderStyle = 1End Sub

Private Sub Label12_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label12.BorderStyle = 0End Sub

Private Sub clear()Text2.Text = ""Text1.Text = ""Text3.Text = ""Text4.Text = ""cardlistEnd Sub

Private Sub cardlist()strsel = "SELECT card.cardname as Name, card.Cardtype as Type, card.cardcolor as Color , " & _" total_card.[Total Of Cardtype] as Total" & _" FROM card LEFT JOIN total_card ON card.cardsr = total_card.cardsr"Set rs = con.Execute(strse)Set dg.DataSource = rsLabel16.Caption = rs.RecordCount & " Record"setgridEnd Sub

Private Sub search()If Combo1.ListIndex = 0 Thenstrsel = "Select * from Card where cardname like '" & Text5.Text & "%'"ElseIf Combo1.ListIndex = 1 Thenstrsel = "Select * from Card where cardsr like '" & Text5.Text & "%'"ElseIf Combo1.ListIndex = 2 Thenstrsel = "Select * from Card where cardtype like '" & Text5.Text & "%'"End IfSet rs = con.Execute(strse)Set dg.DataSource = rsEnd Sub

Private Sub setgrid()If rs.BOF = True Or rs.EOF = True ThenElsedg.Columns(0).Width = 1500dg.Columns(1).Width = 1500dg.Columns(2).Width = 1000End IfEnd Sub

Private Sub Timer1_Timer()If Label5.Height >= 375 ThenLabel5.Height = 0ElseLabel5.Height = Label5.Height + 50End IfEnd Sub

Private Sub Timer2_Timer()Label16.Visible = TrueTimer2.Enabled = FalseTimer3.Enabled = TrueEnd Sub

Private Sub Timer3_Timer()Label16.Visible = FalseTimer2.Enabled = TrueTimer3.Enabled = FalseEnd Sub

Code for Retailer ;-Private Sub search()If Combo2.ListIndex = 0 Thenstrsel = "Select * from retailer where retcode like '%" & Text5.Text & "%'"ElseIf Combo2.ListIndex = 1 Thenstrsel = "Select * from retailer where retname like '%" & Text5.Text & "%'"ElseIf Combo2.ListIndex = 2 Thenstrsel = "Select * from retailer where blockno like '%" & Text5.Text & "%'"End IfSet rs = con.Execute(strsel)Set dg.DataSource = rssetgridEnd Sub

Private Sub Command1_Click()strins = "INSERT INTO retailer VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "','" & Me.Text3.Text & "'," & Me.DTPicker1.Value & ",'" & Me.Text4.Text & "','" & Me.Combo1.Text & "','" & Text7.Text & "','" & Text6.Text & "','" & Text1.Text & "','" & Combo3.Text & "','" & CommonDialog1.FileTitle & "')"con.Execute (strsel)clearEnd Sub

Private Sub Command2_Click()clearEnd Sub

Private Sub Command3_Click()setvalEnd Sub

Private Sub Command6_Click()frmmenu.ShowUnload MeEnd Sub

Private Sub Command7_Click()CommonDialog1.DialogTitle = "Select Image"CommonDialog1.ShowOpenLabel21.Caption = CommonDialog1.FileNames = CommonDialog1.FileTitleImage1.Picture = LoadPicture(CommonDialog1.FileName)FileCopy CStr(Label21.Caption), "" & App.Path & "\dbpic\" & CommonDialog1.FileTitle & ""End Sub

Private Sub Form_Load()Form1.ShowMe.Top = 1500Me.Left = 3000setdbobjectclearCombo2.ListIndex = 0End SubPrivate Sub Timer1_Timer()Label6.ForeColor = vbRedTimer1.Enabled = FalseTimer2.Enabled = TrueEnd Sub

Private Sub Timer2_Timer()Label6.ForeColor = vbBlueTimer1.Enabled = TrueTimer2.Enabled = fasleEnd SubPrivate Sub Label10_Click()rs.MovePreviousEnd Sub

Private Sub Label11_Click()rs.MoveNextEnd Sub

Private Sub Label12_Click()If rs.EOF Then rs.MoveLastEnd Sub

Private Sub Label9_Click()If rs.BOF Then rs.MoveFirstEnd Sub

Private Sub clear()Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Text7.Text = ""Text6.Text = ""Combo2.AddItem "ID "Combo2.AddItem "Retailer Name"Combo2.AddItem "Phone "Combo2.AddItem "Address "dtpicker1value = DateaddblockretailerlistCombo1.clearCombo1.Text = "----------Select----------"setgridEnd SubPrivate Sub addblock()strsel = "Select blockno ,blockname FROM block"Set rs = con.Execute(strsel)Combo1.clearWhile rs.EOF = FalseCombo1.AddItem rs!blocknors.MoveNextWendEnd Sub

Private Sub Text5_Change()searchEnd Sub

Private Sub setval()Command4.Enabled = TrueCommand1.Enabled = FalseCommand4.Visible = TrueCommand1.Visible = FalseEnd Sub

Private Sub retailerlist()strsel = "select * from retailer"Set rs = con.Execute(strsel)Set dg.DataSource = rsEnd SubPrivate Sub setgrid()Dim i As IntegerFor i = o To 6 Step 1dg.Columns(i).DataField = rs.Fields(i)Next idg.Columns(0).Caption = "ID"dg.Columns(1).Caption = "Name"dg.Columns(2).Caption = "Father Name"dg.Columns(3).Caption = "Date Of Birth"dg.Columns(4).Caption = "Address"End Sub

Code for Master Card ;-Private Sub Combo3_LostFocus()If Combo3.Text = "---------Select---------" ThenElsestrsel = "select * from consumer where code ='" & Combo3.Text & "'"Set rs = con.Execute(strse)s1 = rs!blocknostrsel = "select * from shop where blockno ='" & s1 & "'"Set rs = con.Execute(strse)Text3.Text = rs!shopcodecardlistEnd IfEnd Sub

Private Sub Command1_Click()If Text1.Text = "" Or Text2.Text = "" ThenLabel14.Caption = "Fill All Details"Elsestrsel = "select cardsr from card where cardname ='" & Combo1.Text & "'"Set rs = con.Execute(strse)s = rs!cardsrstrins = "INSERT INTO card_allotment VALUES('" & Me.Text1.Text & "'," & _ "'" & Me.Text2.Text & "'" & _ ",'" & s & "'," & _ "'" & Me.Combo3.Text & "'," & _ "'" & Me.Text3.Text & "'," & _ "'" & Me.DTPicker1.Value & "')"con.Execute (strins)clearEnd IfText1.SetFocusEnd Sub

Private Sub Command3_Click()With rsText1.Text = !allotmentnoText2.Text = !cardnodtpicker1value = !allotdateCombo3.Text = !codeText3.Text = !shopcodeCombo1.Text = !cardnameText5.Text = Text1.TextEnd WithCommand4.Visible = TrueCommand1.Visible = FalseEnd Sub

Private Sub Command6_Click()frmmenu.ShowUnload MeEnd Sub

Private Sub Form_Load()Form1.ShowMe.Top = 2000Me.Left = 3000setdbobjectclearEnd SubPrivate Sub Label10_Click()rs.MovePreviousEnd Sub

Private Sub Label11_Click()rs.MoveNextEnd Sub

Private Sub Label12_Click()If rs.EOF ThenElsers.MoveLastEnd IfEnd Sub

Private Sub Label9_Click()If rs.BOF ThenElsers.MoveFirstEnd IfEnd SubPrivate Sub addconsumer()strsel = "Select * from consumer"Set rs = con.Execute(strse)Combo3.clearWhile rs.EOF = FalseCombo3.AddItem rs!coders.MoveNextWendEnd SubPrivate Sub addcard()strsel = "Select * from card"Set rs = con.Execute(strse)Combo1.clearWhile rs.EOF = FalseCombo1.AddItem rs!cardnamers.MoveNextWendEnd Sub

Private Sub clear()Combo4.AddItem "Allotment NN"Combo4.AddItem "Consumer name"Combo4.AddItem "Card Type"Command4.Visible = FalseCommand1.Visible = TrueText1.Text = ""Text2.Text = ""Text3.Text = ""Label14.Caption = ""addcardaddconsumercardlistCombo1.Text = "---------Select---------"Combo3.Text = "---------Select---------"Combo4.ListIndex = 0End Sub

Private Sub cardlist()strsel = "SELECT Card_allotment.Allotmentno, Card_allotment.Cardno, consumer.conname,card.cardname, Card_allotment.Allotdate,card.cardsr,consumer.code,Card_allotment.shopcode " & _"FROM consumer INNER JOIN (card INNER JOIN Card_allotment ON card.cardsr = Card_allotment.Cardsr) ON consumer.code = Card_allotment.code"Set rs = con.Execute(strse)Set dg.DataSource = rssetgridEnd Sub

Private Sub setgrid()dg.Columns(0).Width = 2000dg.Columns(1).Width = 2000dg.Columns(2).Width = 2000dg.Columns(3).Width = 2000dg.Columns(4).Width = 2000dg.Columns(0).Caption = "Allotment No"dg.Columns(1).Caption = "Card No"dg.Columns(2).Caption = "Consumer "dg.Columns(3).Caption = "Card Name"dg.Columns(4).Caption = "Alloted Date"

If rs.BOF = True Or rs.EOF = True ThenLabel13.Caption = "Record Not Found"ElseLabel13.Caption = rs.RecordCount & " Record Found"dg.Columns(0).DataField = rs!allotmentnodg.Columns(1).DataField = rs!cardnodg.Columns(2).DataField = rs!connamedg.Columns(3).DataField = rs!cardnamedg.Columns(4).DataField = rs!allotdateEnd Ifdg.Caption = "Card Alloted Details"End Sub

Private Sub search()strsel = "SELECT Card_allotment.Allotmentno, Card_allotment.Cardno, consumer.conname, card.cardname, Card_allotment.Allotdate, Card_allotment.shopcode, Card_allotment.Cardsr, Card_allotment.code" & _" FROM consumer INNER JOIN (card INNER JOIN Card_allotment ON card.cardsr = Card_allotment.Cardsr) ON consumer.code = Card_allotment.code where allotmentno like '" & Text5.Text & "%'"Set rs = con.Execute(strse)Set dg.DataSource = rsLabel13.Caption = rs.RecordCount & " Record Found"End Sub

Private Sub Text1_Change()Text2.Text = Text1.TextEnd Sub

Private Sub Text5_Change()searchsetgridEnd Sub

Code for master Supply:-Private Sub clear()DTPicker1.Value = DateText1.Text = ""Text2.Text = ""new_invoiceaddshopEnd SubPrivate Sub new_invoice()strsel = "SELECT * FROM product_supply"Set rs = con.Execute(strsel)If rs.EOF = False Thenrs.MoveLastText3.Text = Val(rs!Invoiceno) + 1ElseText3.Text = "1"End IfEnd SubPrivate Sub addshop()strsel = "SELECT shopcode FROM shop"Set rs = con.Execute(strsel)While rs.EOF = FalseCombo1.AddItem rs!shopcoders.MoveNextWendEnd SubPrivate Sub showlist()strsel = "select * form bill_details where invoiceno like '" & Val(Text3.Text) & "'"Set rs = con.Execute(strsel)Set dg.DataSource = rsEnd SubPrivate Sub Combo1_Click()strsel = "SELECT shopcode as Shop,pname as Product,total as Qty,total_amt as Amt from shop_total_qty_amt where shopcode like '" & Combo1.Text & "'"Set rs = con.Execute(strsel)Set dg.DataSource = rsdg.Caption = "Shop : " & Combo1.Textadd_productEnd SubPrivate Sub Combo2_Click()strsel = "Select * from check_supplied where status like 'Pending' and shopcode like '" & Combo1.Text & "' and pname like '" & Combo2.Text & "'"Set rs = con.Execute(strsel)If rs.RecordCount = 0 Thenstrsel = "SELECT shopcode as Shop,pname as Product,total as Qty,total_amt as Amt from shop_total_qty_amt where shopcode like '" & Combo1.Text & "' and pname like '" & Combo2.Text & "'"Set rs = con.Execute(strsel)Text1.Text = rs!qtyText2.Text = rs!amtText4.Text = Val(Text4.Text) + Val(Text2.Text)ElseMsgBox "Product has been supplied"End IfEnd Sub

Private Sub Command2_Click()strsel = "Select invoiceno,supp_date from product_supply where invoiceno like '" & Val(Text3.Text) & "'"Set rs = con.Execute(strsel)If rs.RecordCount = 0 Thenstrins = "insert into product_supply(invoiceno,supp_date,shopcode,status) values " & _ " ( '" & Val(Text3.Text) & "', " & _ " '" & DTPicker1.Value & "', " & _ " '" & Combo1.Text & "', " & _ " 'Pending') "con.Execute (strins)End Ifstrsel = "select pcode from product where '" & Combo2.Text & "'"Set rs = con.Execute(strsel)s = rs!pcodeSet rs = con.Execute(strsel)strins = "insert into supplied_product values " & _ " ( '" & Val(Text3.Text) & "', " & _ " '" & s & "', " & _ " '" & Text1.Text & "', " & _ " '" & Text2.Text & "') "con.Execute (strins)Combo2.SetFocusText1.Text = ""Text2.Text = ""End Sub

Private Sub Command3_Click()Command2_Clickclearnew_invoicedetailsEnd Sub

Private Sub Command4_Click()frmmenu.ShowUnload MeEnd Sub

Private Sub Form_Load()Form1.ShowMe.Top = 2500Me.Left = 2500setdbobjectcleardetailsEnd Sub

Private Sub Timer1_Timer()Label9.ForeColor = vbRedTimer1.Enabled = FalseTimer2.Enabled = TrueEnd Sub

Private Sub Timer2_Timer()Label9.ForeColor = vbBlueTimer1.Enabled = TrueTimer2.Enabled = FalseEnd Sub

Private Sub details()strsel = "SELECT shopcode as Shop,pname as Product,total as Qty,total_amt as Amt from shop_total_qty_amt "Set rs = con.Execute(strsel)Set dg.DataSource = rsEnd Sub

Private Sub add_product()Combo2.clearWhile rs.EOF = FalseCombo2.AddItem rs!productrs.MoveNextWendEnd Sub

Code for Sales:-Private Sub Combo1_Click()addproductEnd Sub

Private Sub new_invoice()strsel = "SELECT * FROM consumer_sales"Set rs = con.Execute(strsel)If rs.EOF = False Thenrs.MoveLastText4.Text = Val(rs!bill_no) + 1ElseText4.Text = "1"End IfEnd SubPrivate Sub Timer1_Timer()Label9.ForeColor = vbRedTimer1.Enabled = FalseTimer2.Enabled = TrueEnd Sub

Private Sub Timer2_Timer()Label9.ForeColor = vbBlueTimer1.Enabled = TrueTimer2.Enabled = FalseEnd Sub

Private Sub Combo2_Click()strsel = "select pname as Product,qty as Qty ,amt as Amt from query8 " & _" where username like '" & frmmenu.Label3.Caption & "' and cardno like '" & Combo1.Text & "' and pname like '" & Combo2.Text & "'"Set rs = con.Execute(strsel)Text1.Text = rs!qtyText2.Text = rs!amtText3.Text = Val(Text3.Text) + Val(Text2.Text)

End Sub

Private Sub Command2_Click()strsel = "select bill_no from consumer_sales where bill_no like '" & Text4.Text & "'"Set rs = con.Execute(strsel)If rs.RecordCount = 0 Thenstrins = "insert into consumer_sales values " & _ " ( '" & Val(Text4.Text) & "', " & _ " '" & DTPicker1.Value & "', " & _ " '" & s & "', " & _ " '" & Combo1.Text & "','0')"con.Execute (strins)ElseEnd Ifstrsel = "Select pcode from product where pname like '" & Combo2.Text & "'"Set rs = con.Execute(strsel)s = rs!pcodestrsel = "select * from con_product where bill_no like '" & Text4.Text & "' and pcode like '" & s & "'"Set rs = con.Execute(strsel)If rs.RecordCount = 0 Thenstrins = "insert into con_product values" & _ " ( '" & Val(Text4.Text) & "', " & _ " '" & s & "', " & _ " '" & Text1.Text & "', " & _ " '" & Text2.Text & "') "con.Execute (strins)ElseMsgBox "Product has been sold", vbInformation, "ERS"End IfCombo2.SetFocusText1.Text = ""Text2.Text = ""Combo2.Text = "------Select---------"End Sub

Private Sub Command3_Click()strins = "UPDATE Consumer_sales INNER JOIN con_product ON Consumer_sales.bill_no = con_product.bill_no SET " & _" total_amt='" & Val(Text3.Text) & "' where Consumer_sales.bill_no like '" & Val(Text4.Text) & "'"con.Execute (strins)Combo1.SetFocusText1.Text = ""Text2.Text = ""Text3.Text = 0Combo1.Text = "------Select---------"End Sub

Private Sub Command4_Click()frmmenu.ShowUnload MeEnd Sub

Private Sub Form_Load()Form1.ShowsetdbobjectclearMe.Top = 2500Me.Left = 2500End Sub

Private Sub addcard()strsel = "select distinct cardno as Card from query8 where username like 'retailer3'" 'like '" & frmmenu.Label3.Caption & "'"Set rs = con.Execute(strsel)Combo1.clearWhile rs.EOF = FalseCombo1.AddItem rs!cardrs.MoveNextWendEnd Sub

Private Sub addproduct()strsel = "select retcode,pname as Product,qty as Qty ,amt as Amt from query8 " & _" where username like 'retailer3' and cardno like '" & Combo1.Text & "'"Set rs = con.Execute(strsel)s = rs!RetcodeCombo2.clearWhile rs.EOF = FalseCombo2.AddItem rs!productrs.MoveNextWendEnd Sub

Private Sub clear()DTPicker1.Value = DateCombo1.Text = "------Select------"Combo2.Text = "------Select------"addcardText1.Text = ""Text2.Text = ""new_invoiceEnd Sub

Code for supplier:-Private Sub Command10_Click()Set supp_list.DataSource = rssupp_list.ShowEnd Sub

Private Sub Command11_Click()Set suppsingle.DataSource = rssuppsingle.ShowEnd Sub

Private Sub Command5_Click()strins = "INSERT INTO supplier VALUES('" & Me.Text1.Text & "'," & _ "'" & Me.Text2.Text & "'," & _ "'" & Me.Text3.Text & "'," & _ "'" & Me.Text5.Text & "'," & _ "'" & Me.Text4.Text & "'," & _ "'" & Me.Text7.Text & "'," & _ "'" & Me.Text1.Text & "')"con.Execute (strins)For i = 0 To List2.ListCount - 1strsel = "SELECT * FROM Product WHERE pname LIKE '" & List2.List(i) & "'"Set rs = con.Execute(strse)s = rs!pcodestrins = "INSERT INTO supp_product VALUES('" & Me.Text1.Text & "'," & _ " '" & s & "') "con.Execute (strins)Next iclearEnd Sub

Private Sub Command7_Click()Combo1.ListIndex = 0With rsText6.Text = !suppcodeText1.Text = !suppcodeText2.Text = !suppnameText3.Text = !companyText4.Text = !suppcityText5.Text = !suppaddText7.Text = !contactEnd WithList1.clearstrsel = "SELECT supp_product.suppcode, product.pname" & _" FROM product INNER JOIN supp_product ON product.pcode = supp_product.pcode WHERE suppcode='" & Text1.Text & "'"Set rs = con.Execute(strsel)While rs.EOF = FalseList1.AddItem CStr(rs!pname)rs.MoveNextWendCommand5.Visible = FalseCommand8.Visible = TrueEnd Sub

Private Sub Command8_Click()s = Text1.Textstrins = "UPDATE supplier INNER JOIN supp_product ON supplier.suppcode = supp_product.suppcode SET " & _ "supplier.suppcode='" & Text1.Text & "'," & _ "suppname= '" & Me.Text2.Text & "'," & _ "suppadd= '" & Me.Text5.Text & "'," & _ "company= '" & Me.Text3.Text & "'," & _ "suppcity= '" & Me.Text4.Text & "'," & _ "contact= '" & Me.Text7.Text & "'," & _ "username= '" & Me.Text1.Text & "'" & _ " WHERE supplier.suppcode='" & Me.Text6.Text & "'"con.Execute (strins)clearCommand8.Visible = FalseCommand5.Visible = TrueEnd Sub

Private Sub Command9_Click()frmmenu.ShowUnload MeEnd Sub

Private Sub Form_Load()Form1.ShowMe.Top = 1500Me.Left = 3000setdbobjectclearCombo1.Text = "--------Select----------"Combo1.AddItem "Code"Combo1.AddItem "Name"Combo1.AddItem "City"Combo1.AddItem "Address"Combo1.ListIndex = 0End Sub

Private Sub Command1_Click()List2.AddItem CStr(List1.List(List1.ListIndex))List1.RemoveItem (List1.ListIndex)End Sub

Private Sub Command2_Click()Dim i As IntegerFor i = 0 To List1.ListCount - 1List2.AddItem CStr(List1.List(i))Next iList1.clearEnd Sub

Private Sub Command3_Click()List1.AddItem CStr(List2.List(List2.ListIndex))List2.RemoveItem (List2.ListIndex)End Sub

Private Sub Command4_Click()For i = 0 To List1.ListCount - 1List1.AddItem CStr(List2.List(i))Next iList2.clearEnd Sub

Private Sub Command6_Click()clearEnd Sub

Private Sub Label10_Click()If Not rs.BOF Thenrs.MovePreviousElseEnd IfEnd Sub

Private Sub Label10_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 1End Sub

Private Sub Label10_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label10.BorderStyle = 0End Sub

Private Sub Label11_Click()If Not rs.EOF Thenrs.MoveNextElseEnd IfEnd Sub

Private Sub Label11_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label11.BorderStyle = 1End Sub

Private Sub Label11_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label11.BorderStyle = 0End Sub

Private Sub Label12_Click()rs.MoveLastEnd Sub

Private Sub Label12_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label12.BorderStyle = 1End Sub

Private Sub Label12_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label12.BorderStyle = 0End Sub

Private Sub Label9_Click()rs.MoveFirstEnd Sub

Private Sub Label9_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label9.BorderStyle = 1End Sub

Private Sub Label9_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label9.BorderStyle = 0End Sub

Private Sub Text6_Change()searchEnd Sub

Private Sub addproduct()strsel = "SELECT * FROM product"Set rs = con.Execute(strsel)List1.clearWhile rs.EOF = FalseList1.AddItem CStr(rs!pname)rs.MoveNextWendEnd Sub

Private Sub clear()Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Text5.Text = ""Text6.Text = ""Text7.Text = ""addproductsupplistEnd Sub

Private Sub supplist()strsel = "SELECT * FROM supplier "Set rs = con.Execute(strsel)Set dg.DataSource = rssetgridEnd Sub

Private Sub setgrid()lbl.Caption = rs.RecordCount & " Record Found"Dim i As IntegerFor i = 0 To 5 Step 1dg.Columns(i).DataField = rs.Fields(i)Next idg.Columns(0).Caption = "Code"dg.Columns(1).Caption = "Name"dg.Columns(2).Caption = "Company"dg.Columns(3).Caption = "Address"dg.Columns(4).Caption = "City"dg.Columns(5).Caption = "Contact"End Sub

Private Sub search()If Combo1.ListIndex = 0 Thenstrsel = "select * from supplier where suppcode like '" & Text6.Text & "%'"ElseIf Combo1.ListIndex = 1 Thenstrsel = "select * from supplier where suppname like '" & Text6.Text & "%'"ElseIf Combo1.ListIndex = 2 Thenstrsel = "select * from supplier where suppcity like '" & Text6.Text & "%'"ElseIf Combo1.ListIndex = 3 Thenstrsel = "select * from supplier where suppadd like '" & Text6.Text & "%'"ElseIf Combo1.ListIndex = 4 Thenstrsel = "select * from supplier where contact like '" & Text6.Text & "%'"End IfSet rs = con.Execute(strsel)Set dg.DataSource = rsIf Not rs.RecordCount = 0 Then setgridEnd Sub

Private Sub Timer1_Timer()If Label17.Height >= 375 ThenLabel17.Height = 0ElseLabel17.Height = Label17.Height + 50End IfEnd Sub

Private Sub Timer2_Timer()lbl.Visible = TrueTimer2.Enabled = FalseTimer3.Enabled = TrueEnd Sub

Private Sub Timer3_Timer()lbl.Visible = FalseTimer2.Enabled = TrueTimer3.Enabled = FalseEnd Sub

Code for Splash :-Dim i As Integer

Private Sub Form_Load()Load masterpagemasterpage.ShowMe.Top = 2500Me.Left = 5500For i = 0 To 14 Step 1Shape2(i).BackColor = &HFF8080Shape2(i).BorderColor = &HFF8080Next iTimer1.Enabled = Truei = 0End Sub

Private Sub Timer1_Timer()If i = 15 ThenTimer1.Enabled = FalseUnload Memain.ShowElseShape2(CInt(i)).BackStyle = 1Shape2(CInt(i)).BackColor = &H8000000Fi = i + 1End IfEnd Sub

Code for Main:-Private Sub Command1_Click()logonEnd Sub

Private Sub Command2_Click()clearEnd Sub

Private Sub Form_Activate()Me.HideEnd Sub

Private Sub clear()Text1.Text = ""Text2.Text = ""Combo1.clearCombo1.Text = "--------Select--------"With Combo1.AddItem "Admin".AddItem "Supplier".AddItem "Retailer".AddItem "User"End WithLabel5.Left = 15250Image1.Height = 1335Timer2.Enabled = TrueEnd Sub

Private Sub Form_Load()Me.Top = (Screen.Height - Me.Height) / 2Me.Left = (Screen.Width - Me.Width) / 2Me.Top = 0Me.Left = 0setdbobjectLabel4.Caption = NowclearEnd Sub

Private Sub logon()strsel = "SELECT * FROM userlogin WHERE Status LIKE '" & Combo1.Text & "' AND username LIKE '" & Text1.Text & "' AND password LIKE '" & Text2.Text & "'"Set rs = con.Execute(strsel)On Error GoTo lIf rs!UserName = Text1.Text And rs!Password = Text2.Text Thenfrmmenu.Label1.Caption = rs!Status & " : "frmmenu.Label3.Caption = rs!UserNamefrmmenu.ShowshowformMe.HideElseLabel6.Caption = "Incorrect Username Or Password"End Ifl:End Sub

Private Sub Timer1_Timer()If Label5.Left = 0 ThenTimer1.Enabled = FalselblEnd IfLabel5.Left = Label5.Left - 50End Sub

Private Sub lbl()Timer1.Enabled = TrueLabel5.Left = 18720End Sub

'Private Sub Timer2_Timer()'If Image1.Height >= 1330 Then'Image1.Height = 0'Else'Image1.Height = Image1.Height + 50'End If'End Sub

Private Sub showform()Select Case Combo1.ListIndexCase 0frmmenu.Frame1.Visible = Truefrmmenu.Frame1.Top = 1800frmmenu.Frame2.Visible = Falsefrmmenu.Frame3.Visible = fslseCase 1frmmenu.Frame1.Visible = Falsefrmmenu.Frame2.Visible = Truefrmmenu.Frame2.Top = 1800frmmenu.Frame3.Visible = FalseCase 2frmmenu.Frame1.Visible = Falsefrmmenu.Frame2.Visible = Falsefrmmenu.Frame3.Visible = Truefrmmenu.Frame3.Top = 1800End SelectEnd Sub

Code for shop :-Private Sub Command4_Click()Command4.Visible = FalseCommand1.Visible = TrueclearEnd Sub

Private Sub Command1_Click()strins = "INSERT INTO shop VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "','" & Me.Text3.Text & "','" & Me.Combo1.Text & "','" & Me.Combo2.Text & "')"con.Execute (strins)clearEnd Sub

Private Sub Command2_Click()clearEnd Sub

Private Sub Command3_Click()Command4.Visible = TrueCommand1.Visible = FalseWith rsText1.Text = rs!shopcodeText2.Text = rs!shopnameText3.Text = rs!saddCombo1.Text = rs!blocknoCombo2.Text = rs!RetcodeText5.Text = rs!shopcodeEnd WithEnd SubPrivate Sub Command6_Click()frmmenu.ShowEnd Sub

Private Sub Form_Load()Form1.ShowMe.Top = 2000Me.Left = 3000setdbobjectCombo3.Text = "---------Select---------"Combo3.AddItem "Shop code"Combo3.AddItem "Shop Name"Combo3.AddItem "Block no"Combo3.AddItem "Retailer Name"Combo3.AddItem "Address"Combo3.ListIndex = 0clearCommand4.Visible = FalseEnd Sub

Private Sub Text5_Change()If Combo3.ListIndex = 0 Thenstrsel = "Select * from shop retailer where shopcode like '%" & Text5.Text & "%' "ElseIf Combo3.ListIndex = 1 Thenstrsel = "Select * from shop where shopname like '%" & Text5.Text & "%' "ElseIf Combo3.ListIndex = 2 Thenstrsel = "Select * from shop where blockno like '%" & Text5.Text & "%' "End IfSet rs = con.Execute(strse)Set dg.DataSource = rssetgridEnd SubPrivate Sub clear()Text1.Text = ""Text2.Text = ""Text3.Text = ""addproductaddretailershoplistEnd SubPrivate Sub addproduct()strsel = "select * from block"Set rs = con.Execute(strse)Combo1.clearWhile rs.EOF = FalseCombo1.AddItem rs!blocknors.MoveNextWendCombo1.Text = "---------Select--------"End SubPrivate Sub addretailer()strsel = "select * from Retailer"Set rs = con.Execute(strse)Combo2.clearWhile rs.EOF = FalseCombo2.AddItem rs!Retcoders.MoveNextWendCombo2.Text = "---------Select--------"End Sub

Private Sub shoplist()strsel = "Select * from shop"Set rs = con.Execute(strse)Set dg.DataSource = rssetgridEnd Sub

Private Sub Label10_Click()rs.MoveFirstEnd Sub

Private Sub Label11_Click()rs.MovePreviousEnd Sub

Private Sub Label12_Click()rs.MoveNextEnd Sub

Private Sub Label13_Click()rs.MoveLastEnd Sub

Private Sub setgrid()'dg.Columns(0).Width = 1300'dg.Columns(1).Width = 1500'dg.Columns(2).Width = 1100'dg.Columns(3).Width = 1000If rs.BOF = True Or rs.EOF = True ThenLabel13.Caption = "Record Not Found"ElseLabel13.Caption = rs.RecordCount & " Record Found"dg.Columns(0).DataField = rs!shopcodedg.Columns(1).DataField = rs!shopnamedg.Columns(2).DataField = rs!blocknodg.Columns(3).DataField = rs!Retcodedg.Columns(4).DataField = rs!sadddg.Columns(0).Caption = "Code"dg.Columns(1).Caption = "Name"dg.Columns(2).Caption = "Retailer"dg.Columns(3).Caption = "Block"dg.Columns(4).Caption = "Address"End Ifdg.Caption = "Shop"End Sub

Code For Master Product :-Private Sub Combo1_Click()strsel = " SELECT product.pname As Product , product_allotment.qty as Qty , product_allotment.amt as Amt " & _" FROM card INNER JOIN (product INNER JOIN product_allotment ON product.pcode = product_allotment.pcode) " & _" ON card.cardsr = product_allotment.cardsr" & _" Where card.cardname='" & Combo1.Text & "'"Set rs = con.Execute(strsel)Set dg.DataSource = rsdg.Caption = Combo1.TextEnd Sub

Private Sub Combo4_Click()detailsEnd Sub

Private Sub Command1_Click()newproductclear1End Sub

Private Sub Command2_Click()clear1End Sub

Private Sub Command3_Click()If rs.State = 1 Then rs.Closers.Open "Select * from product where pname='" & Combo2.Text & "'", con, adOpenKeyset, adLockOptimisticstrins = "INSERT INTO product_allotment VALUES('" & Me.Combo1.Text & "','" & rs!pcode & "'," & Me.Text4.Text & "," & Me.Text5.Text & ")" con.Execute (strsel)Text4.Text = ""Text5.Text = ""Combo1.SetFocusclearEnd Sub

Private Sub Combo3_Click()If Combo3.ListIndex = 0 Thenstrsel = "Select * from card"Set rs = con.Execute(strse)Combo4.clearWhile rs.EOF = FalseCombo4.AddItem rs!cardnamers.MoveNextWendElseIf Combo3.ListIndex = 1 Thenstrsel = "Select * from product"Set rs = con.Execute(strse)Combo4.clearWhile rs.EOF = FalseCombo4.AddItem rs!pnamers.MoveNextWendElseEnd IfCombo4.Text = "-----Select-------"End Sub

Private Sub Command4_Click()clearEnd Sub

Private Sub Command5_Click()Unload MeEnd Sub

Private Sub Command6_Click()frmmenu.ShowUnload MeEnd Sub

Private Sub Form_Load()Form1.ShowMe.Top = 2000Me.Left = 3000setdbobjectclearCombo3.AddItem "Card"Combo3.AddItem "Product"Combo3.AddItem "Card Type"Combo3.ListIndex = 0End Sub

Private Sub newproduct()strins = "INSERT INTO product VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "','" & Me.Text3.Text & "')"con.Execute (strins)End Sub

Private Sub addcard()strsel = "Select * from card"Set rs = con.Execute(strsel)Combo1.clearCombo1.Text = "-----Select------"While rs.EOF = FalseCombo1.AddItem rs!cardnamers.MoveNextWendEnd Sub

Private Sub clear()addcardaddproductText4.Text = ""Text5.Text = ""Combo1.Text = "-------Select--------"Combo2.Text = "-------Select--------"End Sub

Private Sub addproduct()strsel = "Select * from product"Set rs = con.Execute(strsel)Combo2.clearWhile rs.EOF = FalseCombo2.AddItem rs!pnamers.MoveNextWendEnd Sub

Private Sub clear1()Text1.Text = ""Text2.Text = ""Text3.Text = ""End Sub

Private Sub Timer1_Timer()If Label8.Width >= 2775 ThenLabel8.Width = 0ElseLabel8.Width = Label8.Width + 50End IfEnd Sub

Private Sub details()If Combo3.ListIndex = 0 Thenstrsel = " SELECT product.pname, product_allotment.qty, product_allotment.amt" & _" FROM card INNER JOIN (product INNER JOIN product_allotment ON product.pcode = product_allotment.pcode) " & _" ON card.cardsr = product_allotment.cardsr" & _" Where card.cardname='" & Combo4.Text & "'"End IfIf Combo3.ListIndex = 1 Thenstrsel = " SELECT card.cardname as Name, card.Cardtype as Type, product_allotment.qty As Qty, product_allotment.amt as Amt " & _" FROM product INNER JOIN (card INNER JOIN product_allotment ON card.cardsr = product_allotment.cardsr) " & _" ON product.pcode = product_allotment.pcode " & _" Where product.pname like '" & Combo4.Text & "'"End IfIf Combo3.ListIndex = 2 Thenstrsel = " SELECT product.pname, product_allotment.qty, product_allotment.amt" & _" FROM card INNER JOIN (product INNER JOIN product_allotment ON product.pcode = product_allotment.pcode) " & _" ON card.cardsr = product_allotment.cardsr" & _" Where card.cardtype like '" & Combo4.Text & "'"End IfSet rs = con.Execute(strsel)Set dg.DataSource = rsdg.Caption = Combo4.Textdg.Caption = Combo4.Textdg.Columns(1).Width = 1000End Sub

Form menu :-Private Sub Form_Load()Me.Left = 0Me.Top = 0setcolorLabel4.Caption = NowWindowsMediaPlayer1.URL = ("C:\Users\Welcome\Desktop\ers\img\movie.mp4")WindowsMediaPlayer1.Controls.PlayEnd Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)setcolorEnd Sub

Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)setcolorEnd Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)setcolorEnd Sub

Private Sub Label2_Click(index As Integer)selectform indexEnd Sub

Private Sub Label2_MouseMove(index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)setcolorchangecolor indexEnd SubPrivate Sub setcolor()Dim i As IntegerFor i = 0 To Label2.Count - 1Label2(i).BackColor = vbBlueLabel2(i).ForeColor = vbWhiteLabel2(i).FontBold = TrueNext iEnd SubPrivate Sub changecolor(index As Integer)Label2(index).BackColor = vbWhiteLabel2(index).ForeColor = vbBlueEnd SubPrivate Sub selectform(index As Integer)Form1.ShowSelect Case indexCase 0: block.ShowCase 1: frmconsumer.ShowCase 2: masterproduct.ShowCase 3: mastercard.ShowCase 4: masterretailer.ShowCase 5: supplier.ShowCase 6: frmshop.ShowCase 7: frmSearch.ShowCase 8: block.ShowCase 9: change.ShowCase 10: main.ShowCase 11: mastersupply.ShowCase 12: main.ShowCase 13: frmSearch.ShowCase 14: change.ShowCase 15: main.ShowCase 16: Form3.ShowCase 17: sales.ShowCase 18: Form4.ShowCase 19: Form5.ShowCase 20: frmSearch.ShowCase 21: change.ShowCase 22: main.ShowEnd SelectMe.Hidemasterpage.ShowEnd Sub

Private Sub Timer1_Timer()Dim i As IntegerFor i = 1 To 7 Step 1'Image2.Picture = LoadPicture(" & App.Path & " \ img \ 1.jpg")Next iEnd Sub

CONCLUSION

The project has been appreciated by all the users in the organization. It is easy to use, since it uses the GUI provided in the user dialog. User friendly screens are provided. The usage of software increases the efficiency, decreases the effort. It has been efficiently employed as a Site management mechanism. It has been thoroughly tested and implemented.

References

Websites

http://www.google.com http://www.microsoft.com http://www.programmer2programmer.net http://www.codeproject.com http://www.msdn.com. http://www.vb123.com http://www.vbcode.com

Books

Visual Basic Black Book Murach Visual Basic 6.0 Concept of DBMS Office 2007 Made Easy