- Create new form, name (Display.frm), save it as (Display.frm), save your application. The design and the controls on the form will look like this :
- Linking this form to the (MainFrm.frm) is so easy :
Just goto the (MainFrm) form and from the (CmdShow) button called (Manage Friends) event Click(), add this line of code :
Save the project (Ctrl+S) then try the application to navigate to the display from (Display.Frm) - The new form has 3 buttons as shown in the photo, each button execute certain task (Update, Delete, Print) using the TextBoxes above.
- All friends stored in the application's database (MyBook.mdb) will be listed in the (ListBox) control called (LstFrnds) so when you click on a name, it will be displayed on the form's textboxs corresponding to the tables field assigned to it.
- Also you get to update the photo, by clicking on the (Image) control called (Timg) then clicking the [Update] button to store the new photo in the database table (Phones).
- The form has some other features like :
Displaying the current time and date of the Windows OS
A background Image
When you place the mouse cursor on a button, it displayes a text to ask you if you want to execute this button. - If you want to execute the Update process :
Choose a friend from the ListBox, stored Data will be displayed on the form's textboxs
Change any of the Data of the friend (Name, Phone, Home-Phone, Photo)
Click on Update Button
A messagebox will appear to let you know that the update process was successfully done. - If you want to execute the Delete process :
Choose a friend from the ListBox, stored Data will be displayed on the form's textboxs
Click on Delete Button
A messagebox will appear to ask you whether you are sure to delete or now, click yes to confirm or cancel to cancel the process.
A messagebox will appear to let you know that the Delete process was successfully done or not. - If you want to print the friends list on a Crystal Reports report then you click on the Print button. Crystal reports will be used in out application example source code to print out the friends list.
- Before we start coding in the next part#5 we need to make sure that we have all the assets, one of those assets is the ADO2.8 techonology to connect the MS-Access 2003 with MS-Visual Basic 6.0, we will do this like that :
Make sure you close the project and open it again after saving everything