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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Global Query Criteria via Function



 
 
Thread Tools Display Modes
  #1  
Old October 5th, 2006, 05:04 AM posted to microsoft.public.access.queries
Suthee
external usenet poster
 
Posts: 2
Default Global Query Criteria via Function

Hi all,

I have a table in my application that allows a user to define "custom
criteria" to be used in many query objects. This table is accessed via a
form. I've created several functions that perform a DLookup on the values
that the user entered into the specific field in the table. The user is
entering these into a format that would be allowed in the QBE panel.

For example: Not In("300","500","100")
Another example: Not Like "QB*" And Not Like "TC*"

In the queries, in the criteria, I am calling the function. For example, I
might call the function ClientIdFilter() from the criteria box on the QBE
panel of the query. This would call the text string like the examples I
entered above. Unfortunately this is not working. I think access might be
putting " " around the returned function value so the criteria is being used
incorrectly. If the user types, for example, just "300" (without quotes) as
the string in the field of the table for the criteria, the function works
fine as only showing Client ID 300.

Long story short I'm trying to allow a user to define these filters to be
used in the query objects. I need to be able to call these values from VBA
or from a query object. These filters will almost always contain multiple
Client IDs, etc.. Is there a way to do this on my current thought process,
or is there a better way to do this?

TIA for any suggestions.


 




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


All times are GMT +1. The time now is 01:10 AM.


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