If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
"wherecondition" seems to be ignored
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 ) |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
multiselect list box - Allen Brown code | coachjeffery | Using Forms | 1 | April 7th, 2005 05:07 PM |
Setting TextBox value based on WhereCondition value: | [email protected] | Setting Up & Running Reports | 3 | April 6th, 2005 06:04 PM |
WhereCondition | newguy | Setting Up & Running Reports | 5 | March 4th, 2005 03:35 PM |
WhereCondition | Ed the Redhead | Using Forms | 3 | August 19th, 2004 12:41 PM |
WhereCondition ignored when MS Access Form invokes Report | yisraelharris | Using Forms | 1 | June 1st, 2004 01:24 PM |