Results of a query into a textbox

  • Thread starter Stefan van der Hooft
  • Start date
S

Stefan van der Hooft

Hello!

I’ve made a query in Access witch counts the results the last 12 months. I
would like to put this result (only 1 result (number) ) into a textbox on my
form.

At the control source of this specific textbox I select the expression
builder and select the above mentioned Query. But, when I run my form the
only result is: #Name?

Can somebody help me?

Ps. the name of my query is: Q_OE_Ideas__Last12Months_SumOfAantal and this
the content:
SELECT SUM(Binn_Aantal) AS Last12Months
FROM T_OE_Ideas_Queried
WHERE (((T_OE_Ideas_Queried.Date)>=DateAdd("m",-12,Date())));
 
F

fredg

Hello!

I¢ve made a query in Access witch counts the results the last 12 months. I
would like to put this result (only 1 result (number) ) into a textbox on my
form.

At the control source of this specific textbox I select the expression
builder and select the above mentioned Query. But, when I run my form the
only result is: #Name?

Can somebody help me?

Ps. the name of my query is: Q_OE_Ideas__Last12Months_SumOfAantal and this
the content:
SELECT SUM(Binn_Aantal) AS Last12Months
FROM T_OE_Ideas_Queried
WHERE (((T_OE_Ideas_Queried.Date)>=DateAdd("m",-12,Date())));

The query returns only 1 row of data?
If so, in an unbound control's control source....

=DLookUp("[Last12Months]","Q_OE_Ideas__Last12Months_SumOfAantal")
 
S

Stefan van der Hooft

Thank you a lot Fred, it works!!


fredg said:
Hello!

Iʼve made a query in Access witch counts the results the last 12 months. I
would like to put this result (only 1 result (number) ) into a textbox on my
form.

At the control source of this specific textbox I select the expression
builder and select the above mentioned Query. But, when I run my form the
only result is: #Name?

Can somebody help me?

Ps. the name of my query is: Q_OE_Ideas__Last12Months_SumOfAantal and this
the content:
SELECT SUM(Binn_Aantal) AS Last12Months
FROM T_OE_Ideas_Queried
WHERE (((T_OE_Ideas_Queried.Date)>=DateAdd("m",-12,Date())));

The query returns only 1 row of data?
If so, in an unbound control's control source....

=DLookUp("[Last12Months]","Q_OE_Ideas__Last12Months_SumOfAantal")
 

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