A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"wherecondition" seems to be ignored



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 22nd, 2005, 12:26 AM
Bob Howard
external usenet poster
 
Posts: n/a
Default "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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 03:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.