Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem using query to supply Default Value for textfield

Phil M
Guest
 
Posts: n/a
#1: Nov 12 '05
I want a textfield on a form to show the result of a query (see below). Using the expression builder, I set Default Value to:

=[qrySumPaymentsForDonation]![totalPayments]

But when I try the form, it comes up #Name?

What am I doing wrong?

Thanks!

Here's the qrySumPaymentsForDonation:

SELECT SUM(Payments.amount) AS totalPayments
FROM Payments
WHERE Payments.donationID=Forms!Donations!id;



Larry Linson
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Problem using query to supply Default Value for textfield


You cannot use a Query as the Default Value. Consider using the Domain
Aggregate Function "DLookup" instead.

Larry Linson
Microsoft Access MVP

"Phil M" <szatki_NO_SPAM@yahoo.com> wrote in message
news:1103_1075739013@news.rcn.com...[color=blue]
> I want a textfield on a form to show the result of a query (see below).[/color]
Using the expression builder, I set Default Value to:[color=blue]
>
> =[qrySumPaymentsForDonation]![totalPayments]
>
> But when I try the form, it comes up #Name?
>
> What am I doing wrong?
>
> Thanks!
>
> Here's the qrySumPaymentsForDonation:
>
> SELECT SUM(Payments.amount) AS totalPayments
> FROM Payments
> WHERE Payments.donationID=Forms!Donations!id;
>
>[/color]


Closed Thread