Spare Parts Database Project Essay

essay A+

Get Full Essay

Get access to this section to get all the help you need with your essay and educational goals.

Get Access

The company that I have chosen to computerize deals with motor vehicles spare parts and belongs to Mr.

Wong. The Wong Spare Parts and Car Selling Agency was founded in year 2000. It is situated in the south of the island, more precisely, at Mahebourg. Infact it is specialized in almost all spare parts of different types of vehicles, especially buses, lorries and cars, which come from Japan and South Africa.Mr. Wong was facing many problems since five years, as he was operating an old fashion business.

He had to do everything manually, that is, he has to record individually all the stock and place it in a file, which took him hours to do. When he received his goods, he had to update all the new stock. Moreover he had to record all his income and expenses himself. At the end of the month, he had to search for every ledger to make the monthly reports.

Sometimes, he also faced problems with the security of files and other important documents. Furthermore he had to spend hours in searching for a specific account or consignment.Mr. Wong has to note down stock details in files and books. When a client orders a product, Mr.

Wong must go back to the store to see whether the product is still available or not. And in the meantime, other clients who are in a hurry leave the store to go elsewhere. Whenever goods are received, he has to search for the specific documents for updating. Sometimes some documents are misplaced and it becomes very difficult to retrace them.

He has a lot to do such as to count all the spare parts, stock one by one and make necessary records in his book.Mr. Wong wanted such a system in which he can record all stock available and stock sold. He wanted such a program that allows him to save, to update his stock and to fix their price. Moreover he wanted something that allows him to record all discount and credit of his clients. He wanted to change the face of the business.

1.2 INVESTIGATION1. Self: Where is your business situated?Mr. Wong; It is situated at Mahebourg.

2. Self: Since when has it been implemented?Mr. Wong; It exists since the year 2000.3.

Self: In what does the business deal?Mr. Wong; The business deals in the selling of engines and spare parts.4. Self: From where does the business import its goods?Mr.

Wong; The business imports its goods from Japan and South Africa.5. Self: What are the problems that the business is facing?Mr. Wong; The problem that the business is facing is the loss of record as there is not a good Database.6.

Self: Do your business give credit facilities to the client?Mr. Wong; Yes, if we do not give credit facilities to clients, we would never get a good clientele.7. Self: Do you think the computerization of your business will help to reduce the problem you are facing?Mr.

Wong; Yes, I am sure that the computerization of my business will help me to reduce my problem.8. Self: How do you think that it will help you?Mr. Wong; I would have a control on my stock, a good database, and also can update all the stock and at same time fix the price without difficulties.

9. Self: How many employees are there in the business?Mr. Wong: There are three.10. Self: How do you store data when someone comes?Mr. Wong; Well, while issuing the product, the reference number and the price are noted in the book.

11. Self: What happens when an account or an important document is lost?Mr. Wong; If an account is lost and cannot be retraced, I am obliged to close the account, whereas for an important document I have to write to the person to send me another.12. Self: How much salary does an employee get?Mr. Wong; He gets Rs 7000 per month.

13. Self: How many customers do you have?Mr. Wong; Up to date, we have about 200 clients and this is increasing year by year.14.

Self: Do you think of increasing the salary of theemployees?Mr. Wong; Yes, as my profit increases, I will increase their salary, so as to retain them in my business.15. Self: How much did you invest in the business?Mr. Wong; I invested about Rs 100000 in the business.

1.3 Problems with the current systema. Tracing previous orders placed by a customerEach time a costumer comes in to buy an auto part or has a problem with the goods, the information is written on paper. However, I have frequently encountered loss of important documents and the customer gets irritated when asked to produce the duplicate of his receipts.

b. Lack of information about customers.The actual system is not customer friendly that is the Wong spare parts does not have the adequate and relevant information about its customers which thus result in billing errors.c.

Inability to properly control the stock.The current manual system does not provide a proper way of controlling the stock. As there is so huge a stock arriving in the business, he cannot control the stock properly and also does not have a good record of the stock. When a client comes to fetch his order, he must spend time in searching for it.1.

4 Objectives of the new system.The objectives may be stated in both quantitative and qualitative terms.1. The system should consist of a proper database to hold records, so as to minimize loss of records.

2. The database should hold information on item and customer.3. It should be possible to update the stock automatically and inform the suppliers when the re – order level has been reached.4. Customer should be informed on new products by selecting criteria and mail merging.

5. The new system is required to provide the following information;a) A list of all available item and options.b) A list of all customers.6.

Proper reports and receipts should be obtained whenever requested.7. The system should be user-friendly and data entry should be as fast as possible.8.

It should take less than one minute to trace a sparepart for a customer.1.5 Data flowsThe following is the data flow of the proposed system.Item ID,Item detailDetailCustomer Id, name, addressItem ID, MakeTransaction ID, Customer IDItem IDTransaction IDItem ID,Customer IDCustomer name,Address, letters IDReport File1.6 Constraints and limitationsSystem boundaries (scope of proposed system)The system to be developed is a customer information system, and is intended to enhance rather than replace the current system of recording item and customers records. If this proves successful, it will be possible at a future date to replace the current methods of recording records so that the details are typed directly into the computer and the required copies printed out.

This could then be extended to link into a computerized accounts system.SoftwareThe customer has requested that the system be developed using MS Access, so unless a good reason transpired for using an alternative program or package MS Access will be the first choice of software.HardwareIn order to run MS Access, a Pentium with a minimum of 64 MB, and preferably 128 MB, will be required. A fast processor such as a P IV will be needed if the system is not going to appear slow in switching between screens.Mr.

Wong’ employees are familiar with Word and have good keyboard skills, so they should have no problem entering data and learning how to use the system. Mr. Wong would like to improve their knowledge so that they can in the future perform new queries and reports as the need arises.SECTION 2DESIGN2.

1 Consideration of possible solutionsA database package will be ideal for implementing the system for Wong spare part, and as Mr. Wong has requested that it should be done in MS Access. This is the package that must be used. It would probably be possible to implement the system using MS Access or another programming language but it would take longer time and would involve the owner having to buy more software which is not really necessary, as MS Access has all the capabilities required.

I already have some experience of MS Access and it is available both at home and at college for development.Using this package it will be possible to* Set up the necessary tables and relationships.* Produced customized input screens, using MS Access to automate data entry wherever possible and to perform various validations.* Use MS Access modules to enable fast searches for a particular Customer and past stay.* Design reports are needed.* Implement a customized menu system.

2.2 Database designThe database contains two entities, which are CUSTOMER, ITEM and TRANSACTION.Tables will be created for each of the entities.Tables will be created for each of these entities.2.3 Definition of data requirementsThe tables will contain the following data.

ITEM DETAILAttribute nameData type and lengthValidationItem codeText (4)Unique primary keyMakeText (50)ModelText (50)PriceNumeric (7)QuantityText (3)CUSTOMER DETAILAttribute NameData type and lengthValidationCustomer CodeText (4)Unique primary keyNameText (20)Other NamesText (20)Date Of BirthText (8)AddressText (50)Home Tel NumberText (7)Mobile Tel numberText (7)TRANSACTION DETAILAttribute nameDate type and lengthValidationTransaction codeText (4)Unique primary keyCustomer codeText (4)Item codeText (4)QuantityNumeric (3)PriceCurrency2.4RelationshipItem DetailItem codeTypeMakeModelQuantityPriceCustomer DetailCustomer CodeNameOther NameAddressTel NumberMobile NumberTransaction DetailTransaction CodeCustomer CodeItem CodeQuantityPrice2.5 Design of input formsTwo data entry form are needed.Customer detailsThis form will be used for several purposes so it needs facilities to* Check to see whether a Customer is already on the database.* Add a new Customer.* Look though all the existing records for the current Customer and bring up more details if necessary.

The Customer details form will be as shown on the next page.Item detailsThis form will be used for several purposes so it needs facilities to* Check to see whether an item is already on the database.* Add a new item.* Look though all the existing records for the current car and bring up more details if necessary.The item details form will be as shown on the next page.Customer FileItem FileArticle I.

2.6 Report DesignThe format of all the reports will be similar. The layout of the Customer report is shown below.2.7 Menu DesignThe menu structure is as follows:`2.

8 System Flowchart.2.9 SecurityA password will be attached to the database so that it is only accessible to someone who knows the password. Different access levels are not needed as Mr. Wong’s employees are the only persons who will be using the database.

10 Test StrategyThe test strategy will include five different types of testing as described below:LOGICAL TESTINGThis will be used to test every aspect of each form, report and query as soon as it is implemented, using valid, invalid and extreme data. Test data will be added to test each code module and results compared with expected results. Sufficient data will be added to ensure that there is at least one customer in each category. The test data that will be added initially is shown in Appendix. Subsequent test will often involve adding new data, which will then be deleted when the test works satisfactorily.

FUNCTIONAL TESTINGEach menu item will be tested in turn to ensure that no function has been missed out.SYSTEM TESTINGWhen the system is complete, the whole range of tests will be carried out again to ensure that no errors have been introduced.RECOVERY TESTINGThe computer will be re-booted while the database is open to ensure that data is not lost or corrupted in the event of a power of a power failure.ACCEPTANCE TESTINGThe user will then be involved and asked to test all the capabilities of the program to ensure that all request functions are presented and working in the manner expected. This testing may result in further refinements.SECTION 3TESTINGTEST PLANModule: Password MenuTEST NO.

TESTEXPECTED RESULTREMARKS1Insert correct password and click on ‘Login’Main Menu should appear on the screen.OK2Insert incorrect password and click on ‘Login’A message saying ‘Wrong password’ should appear on the screen.OK3Click on ‘Exit’The program must close.OKModule: Main MenuTEST NO.TESTEXPECTED RESULTREMARKS1Click on ‘Customer File’ command button.Customer File must appear on the screen.

OK2Click on ‘Item File’ command button.Item File must appear on the screen.OK3Click on ‘Transaction File’ command button.Transaction File must appear on the screen.OKModule: Customer FileTEST NO.

TESTEXPECTED RESULTREMARKS1Click on ‘Add’ command button.Must be able to add a record.OK2Click on ‘Save’ command buttonA message box must appear saying ‘Record has been saved’OK3Click on ‘Find’ combo box.Must be able to find a record.OK4Click on ‘Find’ combo box.

Find a record and click on ‘Edit’ command button, edit the record and click on ‘Save’A message box must appear saying ‘Record has been saved’OK5Click on ‘Find’ combo box. Find a record and click on ‘Delete’ command button.Must be able to delete a record.OK6Click on ‘Back to Main Menu’ command button.Main Menu must appear on the screen.OK7Click on ‘Add’ command button.

Add all records except ‘Customer code’ and click on ‘Save’A message box must appear saying ‘Missing Customer Code’OK8Click on ‘Add’ command button. Add all records except ‘Name’ and click on ‘Save’A message box must appear saying ‘Missing Name’OK9Click on ‘Add’ command button. Add all records except ‘Other names’ and click on ‘Save’A message box must appear saying ‘Missing Other names.OK10Click on ‘Add’ command button. Add all records except ‘Address’ and click on ‘Save’A message box must appear saying ‘Missing Address’OK11Click on ‘Add’ command button. Add all records except ‘Home Tel Number’ and click on ‘Save’A message box must appear saying ‘Missing Home Tel Number’OK12Click on ‘Add’ command button.

Add all records except ‘Mobile Tel Number’ and click on ‘Save’A message box must appear saying ‘Missing Mobile Tel Number’OK13Click on ‘Add’ command button. Add all records except ‘ID Card Number’ and click on ‘Save’A message box must appear saying ‘Missing ID Card Number’OKModule: Item FileTEST NO.TESTEXPECTED RESULTREMARKS1Click on ‘Add’ command button.Must be able to add a record.OK2Click on ‘Save’ command buttonA message box must appear saying ‘Record has been saved’OK3Click on ‘Find’ combo box.Must be able to find a record.

OK4Click on ‘Find’ combo box. Find a record and click on ‘Edit’ command button, edit the record and click on ‘Save’A message box must appear saying ‘Record has been saved’OK5Click on ‘Find’ combo box. Find a record and click on ‘Delete’ command button.Must be able to delete a record.OK6Click on ‘Back to Main Menu’ command button.

Main Menu must appear on the screen.OK7Click on ‘Add’ command button. Add all records except ‘Item code’ and click on ‘Save’A message box must appear saying ‘Missing Item Code’OK8Click on ‘Add’ command button. Add all records except ‘Make’ and click on ‘Save’A message box must appear saying ‘Missing Make’OK9Click on ‘Add’ command button.

Add all records except ‘Model’ and click on ‘Save’A message box must appear saying ‘Missing Model’.OK10Click on ‘Add’ command button. Add all records except ‘Colour’ and click on ‘Save’A message box must appear saying ‘Missing Colour’OK11Click on ‘Add’ command button. Add all records except ‘Price’ and click on ‘Save’A message box must appear saying ‘Missing Price’OK12Click on ‘Add’ command button. Add all records and put only 6 digits in ‘Mobile Tel Number’A message box must appear saying ‘Mobile Tel Number must contain 7 digits’OKModule: Transaction FileTEST NO.

TESTEXPECTED RESULTREMARKS1Click on ‘Add’ command button.Must be able to add a record.OK2Click on ‘Save’ command buttonA message box must appear saying ‘Record has been saved’OK3Click on ‘Find’ combo box.Must be able to find a record.OK4Click on ‘Find’ combo box. Find a record and click on ‘Edit’ command button, edit the record and click on ‘Save’A message box must appear saying ‘Record has been saved’OK5Click on ‘Find’ combo box.

Find a record and click on ‘Delete’ command button.Must be able to delete a record.OK6Click on ‘Back to Main Menu’ command button.Main Menu must appear on the screen.

OK7Click on ‘Add’ command button. Add all records except ‘Transaction code’ and click on ‘Save’A message box must appear saying ‘Missing Transaction Code’OK8Click on ‘Add’ command button. Add all records except ‘Item code’ and click on ‘Save’A message box must appear saying ‘Item code’OK9Click on ‘Add’ command button. Add all records except ‘Customer code’ and click on ‘Save’A message box must appear saying ‘Customer code’OK10Click on ‘Add’ command button. Add all records except ‘Quantity’ and click on ‘Save’A message box must appear saying ‘Quantity’OK11Click on ‘Add’ command button. Add all records except ‘Price’ and click on ‘Save’A message box must appear saying ‘Price,OKTest PlanModule: Password MenuTest No2: Inserting incorrect passwordModule: Car fileTest No7: Missing car codeModule: Customer fileTest No14: Mobile Tel Number less than 7 digitsSECTION 4SYSTEM MAINTENANCE4.

1 SYSTEM OVERVIEWThis Customer information system is designed to keep records of Customer profiles and their past purchases. It is designed to run alongside the current manual system of recording purchases, rather than replacing it. The computer will be in the reception and the owner can use it to check whether a customer who comes in is already on the database, or to check on past purchases.New data will be added to the database at a convenient time, possibly at the end of the week. The procedure that the user will fellow is described in the design section.

4.2 TABLES AND RELATIONSHIPSTables and relationships were set up as specified in the design section.4.3 FORMSThe menu structure was set up as specified in the design section.

Forms were used as follows:Main MenuThis is specified as the start-up form and loads automatically when database is opened.All buttons either opening other form or reports, or quitting the database, were placed using wizards.Report MenuAll buttons placed using wizards. Maximise macro runs on opening form.Input FormsThe Customer details form has a combo box displaying Customer codes so that the user can look up the record for any Customer.

The record source for this box is the database.4.4 REPORTSThese are as described in the user manual. All reports were created using wizards and then tailored to produce a more appropriate layout.4.

5 DISCUSSION OF TEST RESULTSOne extra report named Customer details were generated using wizards to give a hard copy of all test data used during testing. This greatly simplified the process of determining the expected output for many of the tests, and what data to use for new tests when new models were added. The report is printed in Appendix.SECTION 5USER DOCUMENTATIONInitial set upPassword MenuThe Password menu is automatically started when the database is loaded.

The password is not case sensitive but it will only accept ‘Wong’Main MenuThe Main Menu will automatically appear when you enter the password.Item FileAdd a new recordIn order to add a new record, click on Add new and after adding all the information, click on Save.Finding a recordTo find a record, select its code from the Find record combo box.Editing a recordTo edit a record, first find it using the Find record combo box, change the information and click on Edit record.Deleting a recordTo delete a record, first find it using the Find record combo box, change the information and click on Delete record.Customer FileAdd a new recordIn order to add a new record, click on Add new and after adding all the information, click on Save.

Finding a recordTo find a record, select its code from the Find record combo box.Editing a recordTo edit a record, first find it using the Find record combo box, change the information and click on Edit record.Deleting a recordTo delete a record, first find it using the Find record combo box, change the information and click on Delete record.Transaction FileAdd a new recordIn order to add a new record, click on Add new and after adding all the information, click on Save.Finding a recordTo find a record, select its code from the Find record combo box.

Editing a recordTo edit a record, first find it using the Find record combo box, change the information and click on Edit record.Deleting a recordTo delete a record, first find it using the Find record combo box, change the information and click on Delete record.SECTION 6APPRAISALThe system has been completed and installed on the user’s PC. It was completed in the manner originally designed and agreed with the user, and is straightforward to use.Referring to the original objectives listed in the Analysis section:1. It should take less than 30 seconds to establish whether an item or a customer is already in the database.

2. It should be possible to go directly from the Item file’s screen to the entry of a new item.3. Data entry is as fast and easy as possible.4.

The new system provides the following information.a) List of all item.b) List of all customers.c) List of all transactions.

5. The main menu should be displayed automatically when theprogram is loaded and the whole system should be menudriven.6. The owner had some problems initially with data entry,confusing Items and customers, as this aspect works a little differently from the manual system. However he has now entered data for over 100 items and has no problems to report.7.

All reports are implemented as specified.8. The menus work as planned.SECTION 7APPENDIXPassword MenuOption Compare DatabasePrivate Sub Detail_Click()End SubPrivate Sub LOGIN_Click()On Error GoTo Err_LOGIN_ClickDim stDocName As StringDim stLinkCriteria As StringPass.SetFocusIf Pass.Text = “wong” ThenstDocName = “main menu”DoCmd.OpenForm stDocName, , , stLinkCriteriaElseMsgBox “wrong password”End IfExit_LOGIN_Click:Exit SubErr_LOGIN_Click:MsgBox Err.DescriptionResume Exit_LOGIN_ClickEnd SubPrivate Sub Exit_Click()On Error GoTo Err_Exit_ClickDoCmd.CloseExit_Exit_Click:Exit SubErr_Exit_Click:MsgBox Err.DescriptionResume Exit_Exit_ClickEnd SubMain MenuPrivate Sub Command0_Click()On Error GoTo Err_Command0_ClickScreen.PreviousControl.SetFocusDoCmd.FindNextExit_Command0_Click:Exit SubErr_Command0_Click:MsgBox Err.DescriptionResume Exit_Command0_ClickEnd SubPrivate Sub Command2_Click()On Error GoTo Err_Command2_ClickScreen.PreviousControl.SetFocusDoCmd.FindNextExit_Command2_Click:Exit SubErr_Command2_Click:MsgBox Err.DescriptionResume Exit_Command2_ClickEnd SubPrivate Sub Customer_File_Click()On Error GoTo Err_Customer_File_ClickDim stDocName As StringDim stLinkCriteria As StringstDocName = “customerfile”DoCmd.OpenForm stDocName, , , stLinkCriteriaForm_customerfile.Add_record.SetFocusForm_customerfile.Save_record.Enabled = FalseForm_customerfile.Add_record.Enabled = TrueExit_Customer_File_Click:Exit SubErr_Customer_File_Click:MsgBox Err.DescriptionResume Exit_Customer_File_ClickEnd SubPrivate Sub Detail_Click()End SubPrivate Sub item_file_Click()On Error GoTo Err_item_file_ClickDim stDocName As StringDim stLinkCriteria As StringstDocName = “itemfile”DoCmd.OpenForm stDocName, , , stLinkCriteriaForm_itemfile.Add_record.SetFocusForm_itemfile.Save_Record1.Enabled = FalseForm_itemfile.Add_record.Enabled = TrueExit_item_file_Click:Exit SubErr_item_file_Click:MsgBox Err.DescriptionResume Exit_item_file_ClickEnd SubPrivate Sub Transaction_file_Click()On Error GoTo Err_Transaction_file_ClickDim stDocName As StringDim stLinkCriteria As StringstDocName = “Transactionfile”DoCmd.OpenForm stDocName, , , stLinkCriteriaForm_Transactionfile.Add_record.SetFocusForm_Transactionfile.Save_record.Enabled = FalseForm_Transactionfile.Add_record.Enabled = TrueExit_Transaction_file_Click:Exit SubErr_Transaction_file_Click:MsgBox Err.DescriptionResume Exit_Transaction_file_ClickEnd SubPrivate Sub Exit_Click()On Error GoTo Err_Exit_ClickDoCmd.CloseExit_Exit_Click:Exit SubErr_Exit_Click:MsgBox Err.DescriptionResume Exit_Exit_ClickEnd SubItem FileOption Compare DatabasePrivate Sub Add_record_Click()On Error GoTo Err_Add_record_ClickDoCmd.GoToRecord , , acNewRecCom1.SetFocusAdd_record.Enabled = FalseSave_Record1.Enabled = TrueExit_Add_record_Click:Exit SubErr_Add_record_Click:MsgBox Err.DescriptionResume Exit_Add_record_ClickEnd SubPrivate Sub Delete_record_Click()On Error GoTo Err_Delete_record_ClickDoCmd.GoToRecord , , acNewRecExit_Delete_record_Click:Exit SubErr_Delete_record_Click:MsgBox Err.DescriptionResume Exit_Delete_record_ClickEnd SubPrivate Sub Detail_Click()End SubPrivate Sub Form_Load()End SubPrivate Sub Print_Record_Click()On Error GoTo Err_Print_Record_ClickDoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70DoCmd.PrintOut acSelectionExit_Print_Record_Click:Exit SubErr_Print_Record_Click:MsgboxBox Err.DescriptionResume Exit_Print_Record_ClickEnd SubPrivate Sub Item_report_Click()On Error GoTo Err_Item_report_ClickDim stDocName As StringstDocName = “Item report”DoCmd.OpenReport stDocName, acPreviewExit_Item_report_Click:Exit SubErr_Item_report_Click:MsgboxBox Err.DescriptionResume Exit_Item_report_ClickEnd SubPrivate Sub Command26_Click()On Error GoTo Err_Command26_ClickDim stDocName As StringDim stLinkCriteria As StringstDocName = “main menu”DoCmd.OpenForm stDocName, , , stLinkCriteriaExit_Command26_Click:Exit SubErr_Command26_Click:MsgBox Err.DescriptionResume Exit_Command26_ClickEnd SubPrivate Sub Command27_Click()On Error GoTo Err_Command27_ClickDoCmd.GoToRecord , , acNewRecExit_Command27_Click:Exit SubErr_Command27_Click:MsgboxBox Err.DescriptionResume Exit_Command27_ClickEnd SubPrivate Sub Save_record1_Click()On Error GoTo Err_Save_record1_ClickCom1.SetFocusIf Com1.Text = “” ThenMsgBox “Missing Item Code”ElseCom2.SetFocusIf Com2.Text = “” ThenMsgBox “Missing Name”ElseCom3.SetFocusIf Com3.Text = “” ThenMsgBox “Missing Description”ElseCom4.SetFocusIf Com4.Text = “” ThenMsgBox “Missing Net Weight”ElseCom5.SetFocusIf Com5.Text = “” Or Com5.Text = 0 ThenMsgBox “Missing Quantity in stock”ElseCom6.SetFocusIf Com6.Text = “” Or Com6.Text = 0 ThenMsgBox “Missing Unit Price”ElseAdd_record.Enabled = TrueSave_Record1.Enabled = FalseDoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70MsgBox “Record has been saved”End IfEnd IfEnd IfEnd IfEnd IfEnd IfExit_Save_record1_Click:Exit SubErr_Save_record1_Click:MsgBox Err.DescriptionResume Exit_Save_record1_ClickEnd SubPrivate Sub Combo30_AfterUpdate()’ Find the record that matches the control.Dim rs As ObjectSet rs = Me.Recordset.Cloners.FindFirst “[Item code] = ‘” ; Me![Combo30] ; “‘”If Not rs.EOF Then Me.Bookmark = rs.BookmarkEnd SubCustomer FileOption Compare DatabasePrivate Sub Add_record_Click()On Error GoTo Err_Add_record_ClickDoCmd.GoToRecord , , acNewRecCom1.SetFocusSave_record.Enabled = TrueAdd_record.Enabled = FalseExit_Add_record_Click:Exit SubErr_Add_record_Click:MsgBox Err.DescriptionResume Exit_Add_record_ClickEnd SubPrivate Sub Command19_Click()On Error GoTo Err_Command19_ClickScreen.PreviousControl.SetFocusDoCmd.FindNextExit_Command19_Click:Exit SubErr_Command19_Click:MsgBox Err.DescriptionResume Exit_Command19_ClickEnd SubPrivate Sub DeleteRecord_Click()On Error GoTo Err_DeleteRecord_ClickDoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70MsgBox “record has been deleted”Exit_DeleteRecord_Click:Exit SubErr_DeleteRecord_Click:MsgBox Err.DescriptionResume Exit_DeleteRecord_ClickEnd SubPrivate Sub Detail_Click()End SubPrivate Sub Form_Load()Com1.SetFocusSave_record.Enabled = FalseAdd_record.Enabled = TrueEnd SubPrivate Sub Print_Record_Click()On Error GoTo Err_Print_Record_ClickDoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70DoCmd.PrintOut acSelectionExit_Print_Record_Click:Exit SubErr_Print_Record_Click:MsgBox Err.DescriptionResume Exit_Print_Record_ClickEnd SubPrivate Sub Command22_Click()On Error GoTo Err_Command22_ClickDim stDocName As StringstDocName = “Customer report”DoCmd.OpenReport stDocName, acPreviewExit_Command22_Click:Exit SubErr_Command22_Click:MsgBox Err.DescriptionResume Exit_Command22_ClickEnd SubPrivate Sub Customer_report_Click()On Error GoTo Err_Customer_report_ClickDim stDocName As StringstDocName = “Customer report”DoCmd.OpenReport stDocName, acPreviewExit_Customer_report_Click:Exit SubErr_Customer_report_Click:MsgBox Err.DescriptionResume Exit_Customer_report_ClickEnd SubPrivate Sub Customer_Report1_Click()On Error GoTo Err_Customer_Report1_ClickDim stDocName As StringstDocName = “Customer report”DoCmd.OpenReport stDocName, acPreviewExit_Customer_Report1_Click:Exit SubErr_Customer_Report1_Click:MsgBox Err.DescriptionResume Exit_Customer_Report1_ClickEnd SubPrivate Sub Back_Click()On Error GoTo Err_Back_ClickDim stDocName As StringDim stLinkCriteria As StringstDocName = “main menu”DoCmd.OpenForm stDocName, , , stLinkCriteriaExit_Back_Click:Exit SubErr_Back_Click:MsgBox Err.DescriptionResume Exit_Back_ClickEnd SubPrivate Sub Save_Record_Click()On Error GoTo Err_Save_Record_ClickCom1.SetFocusIf Com1.Text = “” ThenMsgBox “Missing Customer Code”ElseCom2.SetFocusIf Com2.Text = “” ThenMsgBox “Missing Name”ElseCom3.SetFocusIf Com3.Text = “” ThenMsgBox “Missing Other Names”ElseCom4.SetFocusIf Com4.Text = “” ThenMsgBox “Missing Address”ElseCom5.SetFocusIf Com5.Text = “” ThenMsgBox “Missing Home Number”ElseCom5.SetFocusIf Len(Com5) ; 7 ThenMsgBox “Home Number must contain 7 digits”ElseCom6.SetFocusIf Com6.Text = “” ThenMsgBox “Missing Mobile Number”ElseCom6.SetFocusIf Len(Com6) ; 7 ThenMsgBox “Mobile Number must contain 7 digits”ElseCom7.SetFocusIf Com7.Text = “” ThenMsgBox “Missing Sex”ElseAdd_record.Enabled = TrueSave_record.Enabled = FalseDoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70MsgBox “Record has been saved”End IfEnd IfEnd IfEnd IfEnd IfEnd IfEnd IfEnd IfEnd IfExit_Save_Record_Click:Exit SubErr_Save_Record_Click:MsgBox Err.DescriptionResume Exit_Save_Record_ClickEnd SubPrivate Sub Combo27_AfterUpdate()’ Find the record that matches the control.Dim rs As ObjectSet rs = Me.Recordset.Cloners.FindFirst “[Customer Code] = ‘” & Me![Combo27] & “‘”If Not rs.EOF Then Me.Bookmark = rs.BookmarkEnd SubTransaction FileOption Compare DatabasePrivate Sub Add_record_Click()On Error GoTo Err_Add_record_ClickDoCmd.GoToRecord , , acNewRecCom1.SetFocusAdd_record.Enabled = FalseSave_record.Enabled = TrueExit_Add_record_Click:Exit SubErr_Add_record_Click:MsgBox Err.DescriptionResume Exit_Add_record_ClickEnd SubPrivate Sub Detail_Click()End SubPrivate Sub Save_Record_Click()On Error GoTo Err_Save_Record_ClickCom1.SetFocusIf Com1.Text = “” ThenMsgBox “Missing Transaction Code”ElseCom2.SetFocusIf Com2.Text = “” ThenMsgBox “Missing customer Code”ElseCom3.SetFocusIf Com3.Text = “” ThenMsgBox “Missing Item Code”ElseCom4.SetFocusIf Com4.Text = “” Or Com4.Text = 0 ThenMsgBox “Missing Quantity”ElseCom5.SetFocusIf Com5.Text = “” Or Com5.Text = 0 ThenMsgBox “Missing Price”ElseAdd_record.Enabled = TrueSave_record.Enabled = FalseDoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70MsgBox “Record has been saved”End IfEnd IfEnd IfEnd IfEnd IfExit_Save_Record_Click:Exit SubErr_Save_Record_Click:MsgBox Err.DescriptionResume Exit_Save_Record_ClickEnd SubPrivate Sub Delete_record_Click()On Error GoTo Err_Delete_record_ClickDoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70MsgBox “Record has been deleted”Exit_Delete_record_Click:Exit SubErr_Delete_record_Click:MsgBox Err.DescriptionResume Exit_Delete_record_ClickEnd SubPrivate Sub Print_Record_Click()On Error GoTo Err_Print_Record_ClickDoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70DoCmd.PrintOut acSelectionExit_Print_Record_Click:Exit SubErr_Print_Record_Click:MsgBox Err.DescriptionResume Exit_Print_Record_ClickEnd SubPrivate Sub Back_to_main_menu_Click()On Error GoTo Err_Back_to_main_menu_ClickDim stDocName As StringDim stLinkCriteria As StringstDocName = “main menu”DoCmd.OpenForm stDocName, , , stLinkCriteriaExit_Back_to_main_menu_Click:Exit SubErr_Back_to_main_menu_Click:MsgBox Err.DescriptionResume Exit_Back_to_main_menu_ClickEnd SubPrivate Sub Combo16_AfterUpdate()’ Find the record that matches the control.Dim rs As ObjectSet rs = Me.Recordset.Cloners.FindFirst “[Transaction code] = ‘” ; Me![Combo16] ; “‘”If Not rs.EOF Then Me.Bookmark = rs.BookmarkEnd SubPrivate Sub Transaction_report_Click()On Error GoTo Err_Transaction_report_ClickDim stDocName As StringstDocName = “Transaction Report”DoCmd.OpenReport stDocName, acPreviewExit_Transaction_report_Click:Exit SubErr_Transaction_report_Click:MsgBox Err.DescriptionResume Exit_Transaction_report_ClickEnd Sub

Get instant access to
all materials

Become a Member
unlock