How?
Property | Setting |
---|---|
Caption | Name you want to appear in the title bar of the form |
DefaultView | Single Form |
ViewsAllowed | Form |
ScrollBars | Neither |
RecordSelectors | No |
NavigationButtons | No |
BorderStyle | Dialog |
Property | Setting |
---|---|
Name | Name that describes the type of criteria; for example, BeginningDate. |
Format | Format that reflects the data type of the criteria. For example, for a date criteria, select a format such as Medium Date. |
You'll add OK and Cancel command buttons to the form after you create macros for them.
How?
Argument | Setting |
---|---|
Form Name | Sales Dialog |
View | Form |
Data Mode | Edit |
Window Mode | Dialog |
Add a second action, CancelEvent, that cancels previewing or printing the report when the Cancel button on the form is clicked.
If the Condition column is not displayed, click Conditions
.
Type the following expression in the Condition column:
Not IsLoaded("Sales Dialog")
Note IsLoaded is a function defined in the Utility Functions module in the Northwind sample database. It's used to check whether a form is open in Form view or Datasheet view. You must define the IsLoaded function in your database before you can use it. (You can copy and paste this function from Northwind into a utility module in your database.)
Create a macro that closes the form.
How?
Give the macro a name, such as Close Dialog. Click the Close action. Then set its action arguments as follows:
Argument | Setting |
---|---|
Object Type | Form |
Object Name | Sales Dialog |
Save | No |
Create a macro for the OK button.
How?
This macro hides the form. Give the macro a name, such as OK, and click the SetValue action.Then set its action arguments as follows:
Argument | Setting |
---|---|
Item | [Visible] |
Expression | No |
Create a macro for the Cancel button.
How?
This macro closes the form. Give the macro a name, such as Cancel, and click the Close action. Then set its action arguments as follows:
Argument | Setting |
---|---|
Object Type | Form |
Object Name | Sales Dialog |
Save | No |
How?
Property | Setting |
---|---|
Name | OK |
Caption | OK |
Default | Yes |
OnClick | Name of the macro; for example, Sales Dialog.OK |
Property | Setting |
---|---|
Name | Cancel |
Caption | Cancel |
OnClick | Name of the macro; for example, Sales Dialog.Cancel |
How?
Between [Forms]![Sales Dialog]![Beginning Date] And [Forms]![Sales Dialog]![Ending Date]
@Beginning_Date datetime, @Ending_Date datetime
and then use those parameters in the WHERE clause; for example:
WHERE Sales.ShippedDate Between @Beginning_Date And @Ending_Date
In an Access project, you set the reference to the controls on the form in the InputParameters property in the report, as shown in the next procedure.
In a Microsoft Access project, set the InputParameters property in the main report.
How?
@Beginning_date datetime = [Forms]![Sales Dialog]![Beginning Date], @Ending_date datetime = [Forms]![Sales Dialog]![Ending Date]
How?
Property | Setting |
---|---|
OnOpen | Name of the macro that opens the Sales Dialog form; for example, Sales Dialog.Open Dialog |
OnClose | Name of the macro that closes the form; for example, Sales Dialog.Close Dialog |