Chapter 5: Forms, Controls, and Data


Overview

Applications use forms, along with reports , to present data. Forms are also a means of accepting and responding to user input. Because database application users interact with an application almost entirely through forms, form design and behavior are very important. This chapter discusses how to use Microsoft Access forms with data and offers a general introduction to working with forms and their controls. You also learn about the more general roles that forms perform, including forms as timers.

The first samples in this chapter illustrate techniques for developing and presenting application splash screens and switchboard forms. In the process, you'll get an introduction to the form's Timer event and to ways of using hyperlinks to invoke Visual Basic for Applications (VBA) procedures. The Timer event is particularly useful when you need to execute an action at regular intervals. For example, this chapter includes a sample that illustrates how to publish a datasheet to a Web site at 30-second intervals with the help of a form's Timer event.

Next , the focus shifts to using forms with data. A progression of examples and samples demonstrate techniques building simple bound forms and linking them to programmatically controlled record sources. Particular attention is paid to how to use ADO recordsets as record sources for forms. After an introduction to using forms with record sources, the chapter switches its focus to main/subform design and data management issues. The presentation of this topic focuses on the parent-child relationship in the data behind the form. You'll learn about the relationships between main/subforms and subdatasheets for tables. The code samples demonstrate how to reference and manipulate the controls in subforms, a subform control on a subform, and how to display an aggregation of subform control values on a main form. Two additional collections of samples round out the treatment of data via forms. One of these sample collections demonstrates conditionally formatting the display of data values on forms. The other collection dwells on techniques for looking up and displaying data via Access forms. A pair of samples illustrates how to support user interactivity via a parameter query and an ADO Command object.

The chapter concludes with a section that demonstrates techniques for enumerating and managing the status of forms in applications, including working with the forms in another Access database file.

Developing solutions with forms is integral to most Access solutions. Therefore, do not expect to find every possible technique for using forms with Access in this chapter. The presentation of reports in the next chapter offers additional information that can help you build Access solutions with forms. Chapter 12 includes more samples of using forms with Access projects, but some of those samples bear on the use of forms with Access database files ”just as many of the samples in this chapter apply to Access projects.

Note  

This book assumes you have some knowledge of VBA, but for more information, see www.programmingmsaccess.com/ForA2002/Ch01A2002.htm . In addition, if you want to learn more about programming classes with VBA, see www.programmingmsaccess.com/ForA2002/Ch09A2002.htm .




Programming Microsoft Office Access 2003
Programming MicrosoftВ® Office Access 2003 (Core Reference) (Pro-Developer)
ISBN: 0735619425
EAN: 2147483647
Year: 2006
Pages: 144
Authors: Rick Dobson

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