Comparing control value to query result

M

magickarle

Hi, I'm looking ofr a way to compare the value of a control (option
group) to a query.
What I'm looking for is to know if the value 1 exsist for a certain
column:
IE:Query1:

SELECT TblFatError.ClnOptGrp, TblFatError.Grade
FROM TblFatError
GROUP BY TblFatError.ClnOptGrp, TblFatError.Grade
HAVING (((TblFatError.Grade)<>0));

Somethimes I will get:
ClnOptGrp Grade
0 1
1 1

OtherTimes I will get:
ClnOptGrp Grade
1 1

And sometimes it will be null.

The OptGrp represents the value of an option group control (which
retuns value 0 or 1 from a form) .
So what I want to do is:
if OptGrp=ClnOptGrp then
if Grade=1 then
Me!SubSubForm2.Locked = False
Else Me!SubSubForm2.Locked = True
End if
End if

My problem is in the comparaison of the Query1 with OptGrp.
I'm not sure how to do a "for each record grouped, compare each record
with OptGrp"
Thank you for any input guys n girls!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top