Touring the Finished Project Tracker Application


Now comes the fun part. You get to see the benefit of that hard work. Let’s quickly look at each screen just to point out the most interesting features. You have already seen the screens in the design process, but it is always fun to see them working with real data in them.

Tip 

You will have to click the Options button next to the security warning when you open the database and enable macros in the database, or none of the code you wrote will be allowed to execute.

For starters, Figure 13-28 illustrates a sample project record on the Project Tracker screen. It shows details about this sample Project Tracking project and also comments that have been entered into the list on the first tab.

image from book
Figure 13-28

Figure 13-29 shows some contacts for the current project. You can view information such as name, phone numbers, and e-mail address. If you click the e-mail button, you will see a screen similar to that shown in Figure 13-30 with the e-mail address of the selected contact already filled in. The capability to integrate e-mail into your applications is really slick and will impress many users. You can also consult Chapter 7 on exporting and Chapter 10 on automation for more information on e-mail integration, for example, through Outlook.

image from book
Figure 13-29

image from book
Figure 13-30

On the other hand, if you select the View Details for Selected Contact button, the Contacts screen opens with the record filtered to only the current one. This is shown in Figure 13-31.

image from book
Figure 13-31

If you want to manage contacts in general, add a contact to the existing project, or delete contacts from the database altogether, you should select the Add/Manage Contacts button shown in Figure 13-29. Figure 13-30 illustrates opening the Contacts form in general and, as you can see, more than just the one record was in the filtered version of Figure 13-31.

If you wish to add the current contact to the current project, select the Add Current Contact to Project button. You should not select this button if the current contact has already been added to the current project. If you do, you will receive a database error message indicating the change could not be made because of a duplicate value problem.

image from book
Figure 13-32

Returning now to the Project Tracker form, if you click on the third tab that contains file attachment information, you can manage file attachments. The example screen in Figure 13-33 shows two attachments that have been linked to the current project. One of them is a PDF document and the other is another Access database.

image from book
Figure 13-33

If you select a file attachment in the list and then select the Preview button, Access will actually open the file in the appropriate program. This feature is implemented using an external DLL function call to SHELLEXECUTE. Figure 13-34 shows what happens when you select the option to preview the example selected in the list shown in Figure 13-33.

image from book
Figure 13-34

Notice how Adobe Acrobat is launched in a separate window. The procedures of the SHELLEXECUTE external function allow you to specify how the external program should open (for example, minimized, maximized, and so on).

Another interesting use of an external function call is to display a file open dialog box to help you search for an attachment. This is shown in Figure 13-35.

image from book
Figure 13-35

There is nothing special about the open dialog box itself. However, the fact that you can use this feature to locate file attachments is special. This is often a difficult task for most readers to implement, and you have just done so with relative ease. After you click the Open button on the dialog, the File Name field on the form is populated with the value. You then can fill in a file description and click the button to actually add the attachment to the list, as shown in Figure 13-36.

image from book
Figure 13-36

As I mentioned briefly earlier, the records you see on the screen and modify have not been saved back to the database yet. You are working with local disconnected records, and controls that are not updated in the database until you click the Save button. If you forget to save, you will lose your work.

A nice enhancement to this application is to keep track of whether changes have been made and then notify users when they are about to lose the changes, such as when they move to another record or close the form. This is beyond the scope of this chapter but is well worth exploring for any application that will be used extensively. Another option for you to consider is adding a dynamic web page that will display the currently pending projects in a web browser.




Beginning Access 2007 VBA
Beginning Access 2007 VBA
ISBN: 0470046848
EAN: 2147483647
Year: 2004
Pages: 143

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net