Prev | Current Page 2006 | Next

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

"Access 2007 Bible"

Although this technique
works well, it requires quite a bit of planning and preparation.
The dialog box operation can be more simply implemented by adding a custom event to the dialog
form that is raised by the dialog and sunk by the main form. Information entered by the user on
the dialog form is passed to the main form as an event argument. The event is raised when the user
closes the dialog form and the information passed as the event argument is captured by the main
form. There is no need for the main form to close or otherwise manage the dialog form.
Let??™s start with the dialog form that raises a custom event. The dialog form is shown in Figure 32-15.
1073
Object-Oriented Programming with VBA 32
FIGURE 32-15
This form uses a custom event to pass data back to the main form.
The user types something into the text box and clicks either OK or Cancel. The OK button passes
the text box??™s contents to the main form, while the Cancel button passes a ???No Data message,
indicating that the user dismissed the dialog box without entering any data.


Pages:
1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
instalacje elektryczne Taylor Made drukarki etykiet wynajem pokoju portfele