Criteria from table

  • Thread starter Thread starter GimpBoy
  • Start date Start date
G

GimpBoy

What I would like to do is save my 'Select Query' criteria in a table, for
example "13 Or 15 Or 18".
So in the criteria section I would simply have to put the location of the
field [tabel].[field].

The problem i'm having is the query is not evaluating the text in the field
as criteria. In other words it is looking for the exact text "13 Or 15 Or
18" instead of treating the Or as it should.

Is there a way to make Access 'Re-Evaluate' the linked text?
-Microsoft office XP
 
What I would like to do is save my 'Select Query' criteria in a table, for
example "13 Or 15 Or 18".
So in the criteria section I would simply have to put the location of the
field [tabel].[field].

The problem i'm having is the query is not evaluating the text in the field
as criteria. In other words it is looking for the exact text "13 Or 15 Or
18" instead of treating the Or as it should.

Is there a way to make Access 'Re-Evaluate' the linked text?
-Microsoft office XP

Only by writing VBA code to actually construct the entire SQL string
of the query. Parameters can only contain actual values, and not
operators such as Or.
 
Hi,


There is a possibility to get a "variable list" with a statement like
this:


.... WHERE ("," & param & ",") LIKE ("*," & fieldname & ",*" )



with param a value like 10,20,32
(note there is NO space after the coma)

then the records will be kept if its fieldName value is 10, 20 or 32.


Hoping it may help,
Vanderghast, Access MVP


John Vinson said:
What I would like to do is save my 'Select Query' criteria in a table, for
example "13 Or 15 Or 18".
So in the criteria section I would simply have to put the location of the
field [tabel].[field].

The problem i'm having is the query is not evaluating the text in the field
as criteria. In other words it is looking for the exact text "13 Or 15 Or
18" instead of treating the Or as it should.

Is there a way to make Access 'Re-Evaluate' the linked text?
-Microsoft office XP

Only by writing VBA code to actually construct the entire SQL string
of the query. Parameters can only contain actual values, and not
operators such as Or.
 
Back
Top