PC Review


Reply
Thread Tools Rate Thread

DoCmd.OpenQuery or DLookup?

 
 
peashoe@yahoo.com
Guest
Posts: n/a
 
      11th Oct 2006
I need a txtTotal textbox to sum all the prices in the table attendees
for a certain school
I created a query:

SELECT Sum(Attendees.[Room Price]) AS SumOfRoomPrice
FROM Attendees, Registrations
WHERE (((Registrations.[School Or
Organization])=[Forms]![Registrations]![School Or Organization]));

Any ideas how I do this?
i tried txtTotal.Value = DoCmd.OpenQuery "Attendee_Price"

OR

How does DLookup work? I tried doing that in the Control Source of the
textbox but it was giving me all the prices, not just the prices for
[School Or Organization]

and I need to make sure that when the user clicks the next record, it
only shows the price for that record (School or Organization)


Thanks in advance
Lisa

 
Reply With Quote
 
 
 
 
Vinayak N
Guest
Posts: n/a
 
      11th Oct 2006
Hi,

I guess you should use the DSum function:

The DSum function is mostly used in forms/reports to dynamically
sum/aggregate the values.

The syntax of the same would be found in the help of Access...

Regards,
Vinayak

(E-Mail Removed) wrote:

> I need a txtTotal textbox to sum all the prices in the table attendees
> for a certain school
> I created a query:
>
> SELECT Sum(Attendees.[Room Price]) AS SumOfRoomPrice
> FROM Attendees, Registrations
> WHERE (((Registrations.[School Or
> Organization])=[Forms]![Registrations]![School Or Organization]));
>
> Any ideas how I do this?
> i tried txtTotal.Value = DoCmd.OpenQuery "Attendee_Price"
>
> OR
>
> How does DLookup work? I tried doing that in the Control Source of the
> textbox but it was giving me all the prices, not just the prices for
> [School Or Organization]
>
> and I need to make sure that when the user clicks the next record, it
> only shows the price for that record (School or Organization)
>
>
> Thanks in advance
> Lisa


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What Do You Use Instead of DoCmd.OpenQuery or DoCmd.RunSQL Mr. JYC Microsoft Access VBA Modules 2 30th Sep 2008 07:31 PM
docmd.openquery MoonBlosm Microsoft Access Queries 3 7th Aug 2008 12:53 PM
DoCmd.OpenQuery Michael Kintner Microsoft Access Form Coding 3 7th Nov 2007 08:39 PM
docmd.openquery jmonty Microsoft Access Forms 0 25th Sep 2003 04:42 PM
Re: docmd.openquery Gina Whipp Microsoft Access Forms 0 25th Sep 2003 04:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:52 PM.