Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The use of "All" in query build

Status
Not open for further replies.

tledwards

Programmer
Feb 4, 2003
86
US
I have several combo boxes on a form for people to design there on query criteria. In one field, named Program, in the data base they select "All" it the record applies to all programs. No problem with this part.

But when they select "All" on the report criteria form the Microsort Visual Basic error message appears
"Run time error "2431". The expression you entered contains invalid syntex.

It works with all other program codes even if there are no records for the program. I am using the following code to build the criteria:

strFilter = BuildCriteria("Program", dbText, Program)

I looked but could not find "All" as a reserved word.
 
The BuildCriteria funciton seems to be like the where clause of a select statement. There is no ALL. You could set up some range that would cover the entire dataset.
 
The word "All" is the data in the Program. There are about 10 records with "All" as the entry for the Program field. I was not trying to use it to set up a range or get all the records.
 
The word "All" is the data in the Program field. There are about 10 records with "All" as the entry for the Program field. I was not trying to use it to set up a range or get all the records.
 
ALL is a reserved SQL word used
1) as predicate in the select clause
2) as predicate in comparaison with subqueries
3) as predicate in union

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top