textbox controlsource

R

rocco

Hello,
in the help it says that a SQL statement can be used as controlsource.
Is this possible with a textbox?
Let says I want a text box to show just one number adn thsi number will come
out from this SQl statment
SELECT COUNT(ID) FROM TBLANAG WHERE RIGHT(ID,2)='gy'

Is there a way to have the controlsource of the textbox referred to thsi
statment without having to save a query and bound the control to that?
Obviously i tried... and obviously it hasn't worked. But maybe I missed
something.

I hope this is clear...
Thanks
 
S

strive4peace

Hi Rocco,

I think you mis-read...

SQL can be used as:
RowSource
RecordSource

but not a ControlSource, which is only one value

try this:

= nz(dCount("ID", "TBLANAG", "RIGHT(ID,2)='gy'"),0)


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

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