J
John R. Schmidt
A portion of my application implements a process derived from the Access
Cookbook (O'Reilly) entitled "Print Only Records Matching A Form's Filter."
To do this, I have a switchboard command button with the caption "Filter
Transactions." The On Click event for this command button calls the
following elementary code segment:
Private Sub cmdFilter_Click()
DoCmd.OpenForm "frmJRS"
End Sub
As in the O'Reilly book, frmJRS is an unbound main form with an embedded
subform bound to a query (qryJRS), which in turn displays its fields as a
datasheet. I have this working. However, there's a problem. Two of the
latter fields are text fields with combo boxes to act as lookups, and they
have the LimitToList property set to True. When I define the filter
conditions for the datasheet using Filter by Form and include one of these
text fields, the scheme fails due to the LimitToList test . If, on the
other hand, I turn off the LimitToList test ahead of time, I can
successfully implement such filtering expressions as In, Between, Like, etc.
Now, at long last, to my question. Can I temporarily disable the
LimitToList test by inserting statements ahead and directly behind the
OpenForm command in the calling subroutine above. Those ahead would set the
LimitToList property to False, while the subsequent statements would
restore this property to True. Is this a sound approach?
And if so, HOW do you reference the fields involved?
Thanks loads for your help. JRS
Cookbook (O'Reilly) entitled "Print Only Records Matching A Form's Filter."
To do this, I have a switchboard command button with the caption "Filter
Transactions." The On Click event for this command button calls the
following elementary code segment:
Private Sub cmdFilter_Click()
DoCmd.OpenForm "frmJRS"
End Sub
As in the O'Reilly book, frmJRS is an unbound main form with an embedded
subform bound to a query (qryJRS), which in turn displays its fields as a
datasheet. I have this working. However, there's a problem. Two of the
latter fields are text fields with combo boxes to act as lookups, and they
have the LimitToList property set to True. When I define the filter
conditions for the datasheet using Filter by Form and include one of these
text fields, the scheme fails due to the LimitToList test . If, on the
other hand, I turn off the LimitToList test ahead of time, I can
successfully implement such filtering expressions as In, Between, Like, etc.
Now, at long last, to my question. Can I temporarily disable the
LimitToList test by inserting statements ahead and directly behind the
OpenForm command in the calling subroutine above. Those ahead would set the
LimitToList property to False, while the subsequent statements would
restore this property to True. Is this a sound approach?
And if so, HOW do you reference the fields involved?
Thanks loads for your help. JRS