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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting query is too complex error

Status
Not open for further replies.

justice2003

Programmer
Joined
Apr 6, 2010
Messages
4
Location
US
This is more of two questions. But my major problem is that I get the query is too complex error when I load up the form where this query is stored as a subform.

If I take out this part it works but I need something like this:
(Mid([combined_x_x]![nxx x x],[Forms]![blank_block_Search]![digits],1) Not In ([Forms]![blank_block_Search]![hiddenlist]))=True)

The hiddenlist field will be a list of numbers comma separated. such as 1,2,3. I know this part will work when I just load up the query and just put in one number for hiddenlist field but it doesn't work for multiple numbers.



here is my full query:

SELECT X_type.[NAME], combined_x_x.[nxx x x], X_type.Type, X_type.Cust_Data
FROM X_type INNER JOIN combined_x_x ON (X_type.X = combined_x_x.X) AND (X_type.NXX = combined_x_x.NXX)
WHERE (((Mid([combined_x_x]![nxx x x],[Forms]![blank_block_Search]![digits],1) Not In ([Forms]![blank_block_Search]![hiddenlist]))=True))
GROUP BY X_type.[NAME], combined_x_x.[nxx x x], X_type.Type, X_type.Cust_Data
HAVING (((X_type.Type) Is Null));
 
It will never work as you expect it to. The query engine can't resolve the hidden list. You must use code or something to change the SQL of the query or use the Instr() function to determine if a single string value is located in another string value.

Duane
Hook'D on Access
MS Access MVP
 
Thanks. That is what I ended up doing, and seems to work better now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top