This SQL use to be a lot simpler. Somehow, access made this way more
complicated than it used to be.
Would this be the crash causer and how can I fix this so that it doesn't
re-write my code?
Thanks/
SELECT t_OIS.ID, First(IIf([Instructions] Is Null,False,True)) AS OISAVAIL
FROM t_OIS
WHERE (((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))=False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=False)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS2]))=False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS2] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=False)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS3]))=False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS3] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=False)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS4]))=False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS4] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=False)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS5]))=False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=False)) OR (((t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like "*" &
[Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like "*" &
[Forms]![f_SearchPanel]![OIS4] & "*" And (t_OIS.Instructions) Like "*" &
[Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS4] & "*" And (t_OIS.Instructions) Like "*" &
[Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS4] & "*" And (t_OIS.Instructions) Like "*" &
[Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS4] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS4] & "*" And (t_OIS.Instructions) Like "*" &
[Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS4] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS4] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS4] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like "*" &
[Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS5] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like "*" &
[Forms]![f_SearchPanel]![OIS4] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS4] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS4] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS3] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS4] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS4] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS4] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS4] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS4] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like "*"
& [Forms]![f_SearchPanel]![OIS3] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS2] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS3] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS3] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS3] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*" And (t_OIS.Instructions) Like
"*" & [Forms]![f_SearchPanel]![OIS2] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS2] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND ((t_OIS.Instructions)
Like "*" & [Forms]![f_SearchPanel]![OIS1] & "*") AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True)) OR
(((IsNull([Forms]![f_SearchPanel]![OIS1]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS2]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS3]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS4]))<>False) AND
((IsNull([Forms]![f_SearchPanel]![OIS5]))<>False) AND
(([FORMS]![f_SearchPanel]![ANDOR2])=True))
GROUP BY t_OIS.ID
ORDER BY t_OIS.ID;
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!
Michel Walsh said:
Jet is limited to 2Gig, and another 2Gig for temporary storage. It seems
your temporary storage hit the limit, mainly if q_lvl_XYZ are queries
themselves, their result is maintained, in full, in the temporary storage
space, and so is the result of other queries those queries may have called,
and so on, in cascade.
Revise the logic of your solution, if possible. Has very little to do with
the top query you presented, I am afraid.
Vanderghast, Access MVP