B
Bob Howard
Hi all (A2K win98se);
I have a main form with three button opening the same secondary form ---
each requires a different subset of the same data.
For "simplicity" I defined one query (with no criteria, hence no Where
clause was generated in the query itself) to be used as the RecordSource of
the secondary form. And I put a "wherecondition" in each of the three
openforms in the main form.
The problem is that the "wherecondition" is being ignored.
Here's an example of one of them:
DoCmd.OpenForm "Donation Process Form", , , "[Deposit Year Table].[Is Year
Open?] = 'Yes' AND [Deposit Batch Table].[Batch Type] = 'D'"
When this failed, I tried an applyfilter in the OnOpen event of the
seconrdary form (applying one of the three filters depending on which data
subset would be used --- I determined this from a parameter passed to the
secondary form). Here's an example of the applyfilter I coded in the OnOpen
event:
DoCmd.ApplyFilter , "Donation Process Form", , , "[Deposit Year Table].[Is
Year Open?] = 'Yes' AND [Deposit Batch Table].[Batch Type] = 'D'"
Please note in the above that I coded the comma so this would be treated as
a wherecondition.
This also accomplished nothing.
So I broke down and created three identical queries, set the criteria in
each, and now I set the RecordSource in the OnOpen event to point to the
correct query. I don't like that because it's a waste of resources and
makes subsequent maintenance difficult since if anything changes, I need to
reflect the identical change in three queries.
Any clues as to what I'm doing wrong??
Bob (@Martureo.Org)
I have a main form with three button opening the same secondary form ---
each requires a different subset of the same data.
For "simplicity" I defined one query (with no criteria, hence no Where
clause was generated in the query itself) to be used as the RecordSource of
the secondary form. And I put a "wherecondition" in each of the three
openforms in the main form.
The problem is that the "wherecondition" is being ignored.
Here's an example of one of them:
DoCmd.OpenForm "Donation Process Form", , , "[Deposit Year Table].[Is Year
Open?] = 'Yes' AND [Deposit Batch Table].[Batch Type] = 'D'"
When this failed, I tried an applyfilter in the OnOpen event of the
seconrdary form (applying one of the three filters depending on which data
subset would be used --- I determined this from a parameter passed to the
secondary form). Here's an example of the applyfilter I coded in the OnOpen
event:
DoCmd.ApplyFilter , "Donation Process Form", , , "[Deposit Year Table].[Is
Year Open?] = 'Yes' AND [Deposit Batch Table].[Batch Type] = 'D'"
Please note in the above that I coded the comma so this would be treated as
a wherecondition.
This also accomplished nothing.
So I broke down and created three identical queries, set the criteria in
each, and now I set the RecordSource in the OnOpen event to point to the
correct query. I don't like that because it's a waste of resources and
makes subsequent maintenance difficult since if anything changes, I need to
reflect the identical change in three queries.
Any clues as to what I'm doing wrong??
Bob (@Martureo.Org)