Microsoft Office Tutorials and References
In Depth Information
E-mailing a Selection
When using these combo boxes, there must be the option to reset the selection.
This is done in the ResetFilter button’s code:
' Reset filter¶
Me.sfrmName.Form.FilterOn = False¶
' Also reset the possibly filled comboboxes¶
Me.cmbFirstname1 = ¶
Me.cmbFirstname2 = ¶
Me.cmbLastName1 = ¶
Me.cmbLastName2 = ¶
Setting FilterOn to False is all that is needed to ensure that filtering is
removed from the subform. The emptying of the combo boxes ensures that the
user is not confused by inconsistent information on the form. The same
mechanism is also used within the cmbLastName combo boxes to make clear
that a new LastName needs to be chosen.
Finally the second method sets the Row Source of the cmbLastName2 to a
query dynamically with a WHERE that is constructed in code:
' When a new FirstName2 has been chosen, the contents¶
' of the combo needs to be refreshed, but first a¶
' possible old selection is reset to space¶
Me.cmbLastName2 = ¶
Me.cmbLastName2.RowSource = SELECT Distinct LastName FROM tblName WHERE
Firstname= & Chr(34) & Me.cmbFirstname2 & Chr(34)¶
E-mailing a Selection
This procedure demonstrates how to e-mail data directly from a database.
Example file:
A009.mdb with form
Scenario: On a general selection form, have a datasheet
subform with all available information. Offer the option to
filter the rows and then e-mail the information to pre-
selected recipient(s).
A form has been added to show the current selections made, as shown in Figure
Search JabSto ::

Custom Search