Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form footer unbound field not doing totals

Status
Not open for further replies.

TammyT

Programmer
Sep 17, 2003
183
US
Form has only 3 fields in the detail - type, date & amount. It's used as a sub-form on another form, to record account transactions for various funds.

The sub-form is set to display in datasheet view, so on the main form they can add as many lines as needed, & always see the previous transactions.

The sub-form has a footer that's supposed to total all entries into the amount field on the detail section. It isn't!

I need to get this total, because I need to then update another field on the main form with that same number.

Help? Thanks!
 
I dont think you can have a totals field in datasheet view. Try using a continuous form formatted as a datasheet.

Pampers [afro]
Keeping it simple can be complicated
 
Sorry - forgot to include that I had to build the sub-form off of the updates table, not a query, as when I used the query I couldn't type in any of the fields on the form - ???
 
If you format as a continuous form, how do you than also format as datasheet?

Also - when I just did it as a form, the form footer field for the total gave me an error, instead of showing $0.
 
I mean, to give it a lay-out of a datasheet. You can do this by positioning the textboxes close together etc.., like in datasheet.



Pampers [afro]
Keeping it simple can be complicated
 
Oh - no, that won't work, as I need it to add lines as they go, so datasheet view is needed.

If you look in the Northwinds Db, they do use the same thing I'm doing (that's where I got it from!), & the sub-form is datasheet view, but does have totals on it's footer that are referred to in the main document.

Thanks!
 
how are ya TammyT . . .
[blue]If you format as a continuous form, how do you than also format as datasheet?[/blue]
[blue]You DON'T![/blue] What you do is make the continuous form look just like a spreadsheet!
[ol][li]All textboxes in the detail area and all labels for those textboxes in the form header are set to white background.[/li]
[li]Line-up the textboxes so they just overlap.[/li]
[li]Line-up the labels over the textboxes.[/li]
[li]Set the Top propery of the textboxes to zero.[/li]
[li]If there's any space under the textboxes pull up the form footer bar till there is no space.[/li][/ol]

Calvin.gif
See Ya! . . . . . .
 
If you look in the Northwinds Db, they do use the same thing I'm doing (that's where I got it from!), & the sub-form is datasheet view, but does have totals on it's footer that are referred to in the main document.

which form is that in Northwind?

Pampers [afro]
Keeping it simple can be complicated
 
TammyT . . .
TammyT said:
[blue]Oh - no, that won't work, as I need it to add lines as they go, so datasheet view is needed.[/blue]
Did someone tell you this? . . . Well there wrong!

I've done many continuous forms this way . . .

Calvin.gif
See Ya! . . . . . .
 
Okay, let's see if I can do all the answers at once!

1) Datasheet view - needed to get the new lines
2) Continuous form - I see, they do add; however, that would make for a very loooong sub-form, or am I just tired? I can format so that each new form is really close, right? Either way - I tried that before - still getting an error in the footer field that has =Sum([Account]) for the control

3) It's the Orders form in Northwind. The sub-form is based on a query, but I don't think I need a query - I just need totals of the amount field.

Thanks, all!
 
1) Datasheet view - needed to get the new lines
a continuous form will aslo show new record line

2) Continuous form - I see, they do add; however, that would make for a very loooong sub-form, or am I just tired? I can format so that each new form is really close, right?
?? the continuousform is/can be as long as the datasheet

Either way - I tried that before - still getting an error in the footer field that has =Sum([Account]) for the control
try: Sum(Nz(Account])

3) It's the Orders form in Northwind. The sub-form is based on a query, but I don't think I need a query - I just need totals of the amount field.

Although in this form, the datasheet contains a footer with a total, it doesn't show on the form. But you can still use it to make a reference on the mainform, like on the Orders-form. The totals in the Orders-form, are not in the footer, but just on the main form.



Pampers [afro]
Keeping it simple can be complicated
 
1 & 2 - yeah, I can see that would work

3 - it doesn't like the syntax!! When I try

=Sum(Nz(Amount))

It says invalid syntax

I tried

+Sum(Nz(Amount)

Same result.

Wierd!
 
=Sum(Nz([Amount])
use the [] to enclose variable

Pampers [afro]
Keeping it simple can be complicated
 
Sorry - I did that, just forgot to type them here
 
Okay, crazy! I just went back & typed it fresh, instead of inserting the Nz - now it took! Go figure.

Anyway - still getting the error
 
TammyT . . .

In the [blue]AfterUpdate[/blue] event of [blue]Amount[/blue], copy/paste the following:
Code:
[blue]   Me.ReCalc[/blue]

Calvin.gif
See Ya! . . . . . .
 
TammyT . . .

You have to edit an amount for it to work! . . .

Calvin.gif
See Ya! . . . . . .
 
TammyT . . .

I ran a simulation for what you say you have and guess what? . . . No Problemo! . . . [blue]and with no intervening code![/blue] The result of this tells me you may have some kind of corruption or:
TammyT said:
[blue]Sorry - forgot to include that I had to build the sub-form off of the updates table, not a query, as [purple]when I used the query I couldn't type in any of the fields on the form - ???[/purple][/blue]
It looks like the problem lies here so be more specific about this! . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top