Prev | Current Page 1649 | Next

Michael R. Groh, Joseph C. Stockman, Gavin Powell, and Cary N. Prague

"Access 2007 Bible"

cboDescription
returns the value of the selected description or a selection like 1992, which would show all of the
vehicles with descriptions beginning with 1992.
874
Professional Database Development Part IV
FIGURE 27-12
Creating a query that references a form control
Linking the dialog box to another form
The frmFilterProducts dialog box (you saw this back in Figure 27-11) does more than just create a
value that can be referenced from a query. It actually contains code to open frmProductsExample4.
The RecordSource property of frmProductsExample4 is set to qryProductFormReference.
Figure 27-13 shows the cmdCancel_Click and cmdOK_Click event procedures behind the
Cancel and OK buttons found on frmFilterProducts.
FIGURE 27-13
Creating a dialog box that opens a form
875
Advanced Data Access with VBA 27
The cmdOK_Click event procedure code opens frmProductsExample4, sets the focus on it, and
then requeries the form to make sure the latest selection is used on the form. The SetFocus
method is necessary to move focus to the form that is opened.


Pages:
1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661
alles klar 1b sprawdziany wycieczki Solina płyty mdf mikrodermabrazja katowice