textbox value (1 Viewer)

Manos39

Registered User.
Local time
Today, 15:34
Joined
Feb 14, 2011
Messages
248
Hello,
please help me on refrase this working ok sql from my form's listbox to same form's textbox value
(because the need of conditional
formating and more)

Code:
SELECT Count(hreomenoylikotbl.ylikoID) AS CountOfylikoID
FROM ylikatbl INNER JOIN hreomenoylikotbl ON ylikatbl.ylikoID = hreomenoylikotbl.ylikoID
WHERE (((IsNull([ypallilosID]))=False))
GROUP BY ylikatbl.eidosylikouID
HAVING (((ylikatbl.eidosylikouID)=[Forms]![ylikamainfrm]![eidosylikouID]));

Count of ylikoID is needed

So far trying my textbox gives 1 as value where should be more
Code:
=DCount("[ylikoID]";"[hreomenoylikotbl]";"[ypallilosID] Is Not Null And [ylikoID]= " & DLookUp("[ylikoID]";"[ylikatbl]";"[eidosylikouID]= " & [Forms]![ylikamainfrm]![eidosylikouID]))
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:34
Joined
May 7, 2009
Messages
19,247
you save your Query and name it (say qryCount)
then on the textbox:

=dlookup("CounOfylikoID","qryCount")
 

Manos39

Registered User.
Local time
Today, 15:34
Joined
Feb 14, 2011
Messages
248
you save your Query and name it (say qryCount)
then on the textbox:

=dlookup("CounOfylikoID","qryCount")
Thanks arnelgp i ll give it a try...

Is there a way for avoiding saving a query and beacause my listbox is working,
to make that invisible and use the value with referencing that in my textbox? both are in same form
I think that makes it more simple
I was trying that before come with my question ..
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:34
Joined
Feb 19, 2002
Messages
43,346
Why does the query have a Having clause? Having clauses should only apply to fields that are in the select clause. Otherwise, the criteria should be in the where clause. Why is the group by field not included in the Select clause? Although you can certainly hide the field, you may be confusing yourself by hiding it.
 

Users who are viewing this thread

Top Bottom