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 ) |
#2
|
|||
|
|||
Guessing that your [Is Year Open?] field is a "yes/no" field? If so, try
this: DoCmd.OpenForm "Donation Process Form", , , "[Deposit Year Table].[Is Year Open?] = True AND [Deposit Batch Table].[Batch Type] = 'D'" -- Ken Snell MS ACCESS MVP "Bob Howard" wrote in message ... 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 ) |
#3
|
|||
|
|||
Well, actually it's a required 3-character text field containing either
"Yes" or "No" (the validation rule specifies accordingly)... I guess I'm sort of a simple soul.... Bob. "Ken Snell [MVP]" wrote in message ... Guessing that your [Is Year Open?] field is a "yes/no" field? If so, try this: DoCmd.OpenForm "Donation Process Form", , , "[Deposit Year Table].[Is Year Open?] = True AND [Deposit Batch Table].[Batch Type] = 'D'" -- Ken Snell MS ACCESS MVP "Bob Howard" wrote in message ... 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 ) |
#4
|
|||
|
|||
BTW, my A2K is part of Office 2K-Pro, SR1... Bob.
"Bob Howard" wrote in message ... 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 ) |
#5
|
|||
|
|||
Thanks anyway, but I just discovered this is a bug in SR-1 documented (along
with the workaround) in MSKB article 269380. Bob. "Bob Howard" wrote in message ... 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 ) |
#6
|
|||
|
|||
Post the SQL of the successful queries and let's see what might be the
difference between them and your "WHERE CONDITION" for the forms. -- Ken Snell MS ACCESS MVP "Bob Howard" wrote in message ... Well, actually it's a required 3-character text field containing either "Yes" or "No" (the validation rule specifies accordingly)... I guess I'm sort of a simple soul.... Bob. "Ken Snell [MVP]" wrote in message ... Guessing that your [Is Year Open?] field is a "yes/no" field? If so, try this: DoCmd.OpenForm "Donation Process Form", , , "[Deposit Year Table].[Is Year Open?] = True AND [Deposit Batch Table].[Batch Type] = 'D'" -- Ken Snell MS ACCESS MVP "Bob Howard" wrote in message ... 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 ) |
#7
|
|||
|
|||
"Bob Howard" wrote in message ... Thanks anyway, but I just discovered this is a bug in SR-1 documented (along with the workaround) in MSKB article 269380. Bob. Yes, this applies to using macros for Apply Filter. (It also is an issue in VBA for those versions of ACCESS too). But it doesn't address your original issue... that the OpenForm action was 'ignoring' your "WhereCondition" expression. -- Ken Snell MS ACCESS MVP |
#8
|
|||
|
|||
Thanks Ken!
I noticed that the article didn't apply to the openform, but since it did apply to the applyfilter (too many apply's in this sentence) I "assumed" that it was the same root problem. My assumption was based on my belief that in the openform usage, Access was probably doing an applyfilter on my behalf behind the scenes. I'll have the opportunity to test this with other copies of Access shortly, so that will give me a better idea as to whether my assumption holds water. Meanwhile, I'm not in a position right now to persue this since I have a workaround operating. I'm scheduled to deliver the next release of my application in two days --- so I'll have to put this matter on the back burner until after I close that out and burn the distribution CDs. Then I'll have a bit more time to investigate this further. I can test this using A2K Runtime on my test machine, and using Access 2003 (is this A23K, or A2K3 ?) at a client site. The application will not function with anything older than A2K (that was the minimum design spec level). Thanks for your continued help. I'll keep eveyone posted in about a week with what I find out. Bob ) ----- Original Message ----- From: Ken Snell [MVP] Newsgroups: microsoft.public.access.forms Sent: Sunday, May 22, 2005 12:00 PM Subject: "wherecondition" seems to be ignored "Bob Howard" wrote in message ... Thanks anyway, but I just discovered this is a bug in SR-1 documented (along with the workaround) in MSKB article 269380. Bob. Yes, this applies to using macros for Apply Filter. (It also is an issue in VBA for those versions of ACCESS too). But it doesn't address your original issue... that the OpenForm action was 'ignoring' your "WhereCondition" expression. -- Ken Snell MS ACCESS MVP |
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 04: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 |