Trying to figure out how to checkbox=true/false based upon query results...

  • Thread starter Thread starter TC
  • Start date Start date
T

TC

You cannot just put a query name in an IIF sttement like that.

Try using the DCount() function to count the records in the query. It is
doc'd in online help.

HTH,
TC
 
I currently have a subform on my main form that lists out text boxes
based upon the matching customer ID. I have a query that counts the
number of records shown and based upon the count being > 0, I'd like
to set a checkbox = true or false if it is not.

I tried using IIF and using the query CountOfSubID field, but that
didn't work:

=IIf(qryCurrentCustomerSubscriptionsCount!CountOfSubID>0,True,False)


Anyone have a suggestion on how to accomplish what I'm looking for?
Either through fixing the method I mentioned or another is great, just
something that works.

Thanks much,
M
 
Hello Matt,

How is this issue going on your side currently? Does TC's suggestion help solve your
problem?

As we know, IIF function can accept function (such as Nz(), IsNull()... )as its parameter rather
than a query. You can use the DCount function to determine the number of records in a
specified set of records and use the returned counting number of the records in the IIF function.
Hopefully that will get you going and meets your needs.

Matt, does this answer your question? If there is anything more I can do to assist you, please
feel free to post it in the group.

Best regards,

Billy Yao
Microsoft Online Support
 
Back
Top