ACC1x: Where Condition Refers to Fields, Not to ControlsID: Q103140
|
On page 348 of the Microsoft Access "Language Reference" manual, the
description for the action argument Where Condition reads:
To open a form in which the value of one of its controls
equals the value of a control on another form, use this
syntax:
[controlname on opened form] =
Forms!formname![controlname on other form]
The description for the action argument Where Condition on page 348
should read:
To open a form and show only records where one of the fields
matches the value of a control on another form, use this
syntax:
[field in opened form's recordsource] =
Forms!formname![controlname on other form]
The action argument Where Condition is used to filter the records in
the form's dynaset. Microsoft Access compares the specified fields in
each record on the form being opened to the controls on the original
form. Records on the form being opened will be included in the dynaset
only if the record's fields satisfy the Where Condition argument.
The steps below demonstrate the correct use of the Where Condition
argument:
Textbox
------------------------
ControlName: ChosenState
Command Button
------------------
OnPush: Open Emp 2
Textbox
------------------------
ControlName: Last Name
ControlSource: Last Name
Textbox
--------------------
ControlName: State
ControlSource: State
Action: OpenForm
----------------------------------------------------------
Formname: Emp 2
Where Condition: [State] = Forms!ChooseState![ChosenState]
Microsoft Access "Language Reference," page 348
Keywords : kbusage FmsProp
Version : 1.0 1.1
Platform : WINDOWS
Issue type :
Last Reviewed: March 25, 1999