dbTalk Databases Forums  

calculation from query

comp.database.ms-access comp.database.ms-access


Discuss calculation from query in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bart
 
Posts: n/a

Default calculation from query - 12-02-2003 , 04:14 AM






I've a query where I keep some fields:

btw
excl
incl
total

I use this query as subform, now here 's my problem

I've got a textfield 'total' where I want to calculate the total from
the query for the loaded form.

I've used the expressionbuilder to perform this:

=Sum([subfrm FaktuurTest].Form!Inclusief)

When I see the form in 'formview' I get the following message:

#Error

Someone got any id?

Reply With Quote
  #2  
Old   
Scott McDaniel
 
Posts: n/a

Default Re: calculation from query - 12-02-2003 , 09:12 PM






Is [subfrm FaktuurTest] a Subform? If so, you must refer to it like this:

Forms("NameOfTheParentForm").Controls("NameOfTheSu bformCONTROL).Form.Control
s("NameOfYourControl")

"Bart" <bart.gybels (AT) skynet (DOT) be> wrote

Quote:
I've a query where I keep some fields:

btw
excl
incl
total

I use this query as subform, now here 's my problem

I've got a textfield 'total' where I want to calculate the total from
the query for the loaded form.

I've used the expressionbuilder to perform this:

=Sum([subfrm FaktuurTest].Form!Inclusief)

When I see the form in 'formview' I get the following message:

#Error

Someone got any id?



Reply With Quote
  #3  
Old   
Ray
 
Posts: n/a

Default Re: calculation from query - 12-03-2003 , 04:17 AM



bart.gybels (AT) skynet (DOT) be (Bart) wrote in message news:<84901bde.0312020214.af1480f (AT) posting (DOT) google.com>...
Quote:
I've a query where I keep some fields:

btw
excl
incl
total

I use this query as subform, now here 's my problem

I've got a textfield 'total' where I want to calculate the total from
the query for the loaded form.

I've used the expressionbuilder to perform this:

=Sum([subfrm FaktuurTest].Form!Inclusief)

When I see the form in 'formview' I get the following message:

#Error

Someone got any id?
Hello Bart.

I'm not quite sure where you have your field located with
the above expression. Sounds like it's on the main form and
not the subform.

Perhaps you should make sure it's in the subform's "Form Footer"
to get the sum of the required field data. Then, on the main form
set a reference to the text field on the sumform.

Example for Sub Form: Make a text box called txtSumData
Source: =Sum([subfrm FaktuurTest].Form!Inclusief)

Example for Main Form: =[subfrmName].[Form]![txtSumData]

Regards,

Ray


Reply With Quote
  #4  
Old   
Bradley
 
Posts: n/a

Default Re: calculation from query - 12-03-2003 , 03:22 PM



"Scott McDaniel" <scott (AT) NO___Spam--thedatabaseplace (DOT) net> wrote

Quote:
Is [subfrm FaktuurTest] a Subform? If so, you must refer to it like this:


Forms("NameOfTheParentForm").Controls("NameOfTheSu bformCONTROL).Form.Control
s("NameOfYourControl")
or simpler....

Forms![ParentForm]![SubformControl].Form![Control]

--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response


Quote:
"Bart" <bart.gybels (AT) skynet (DOT) be> wrote in message
news:84901bde.0312020214.af1480f (AT) posting (DOT) google.com...
I've a query where I keep some fields:

btw
excl
incl
total

I use this query as subform, now here 's my problem

I've got a textfield 'total' where I want to calculate the total from
the query for the loaded form.

I've used the expressionbuilder to perform this:

=Sum([subfrm FaktuurTest].Form!Inclusief)

When I see the form in 'formview' I get the following message:

#Error

Someone got any id?





Reply With Quote
  #5  
Old   
Bart
 
Posts: n/a

Default Re: calculation from query - 12-05-2003 , 06:57 AM



Tnx, this seem to be the problem

Bart

raycait (AT) excite (DOT) com (Ray) wrote in message news:<20ba9f4a.0312030217.6ef56219 (AT) posting (DOT) google.com>...
Quote:
bart.gybels (AT) skynet (DOT) be (Bart) wrote in message news:<84901bde.0312020214.af1480f (AT) posting (DOT) google.com>...
I've a query where I keep some fields:

btw
excl
incl
total

I use this query as subform, now here 's my problem

I've got a textfield 'total' where I want to calculate the total from
the query for the loaded form.

I've used the expressionbuilder to perform this:

=Sum([subfrm FaktuurTest].Form!Inclusief)

When I see the form in 'formview' I get the following message:

#Error

Someone got any id?

Hello Bart.

I'm not quite sure where you have your field located with
the above expression. Sounds like it's on the main form and
not the subform.

Perhaps you should make sure it's in the subform's "Form Footer"
to get the sum of the required field data. Then, on the main form
set a reference to the text field on the sumform.

Example for Sub Form: Make a text box called txtSumData
Source: =Sum([subfrm FaktuurTest].Form!Inclusief)

Example for Main Form: =[subfrmName].[Form]![txtSumData]

Regards,

Ray

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.