Display Subform Record sum on main form (1 Viewer)

sigma788

Registered User.
Local time
Yesterday, 21:07
Joined
Dec 1, 2009
Messages
40
Hi all, I have applied different methods to show subform sum on main form. but it gives me an error.
either i am doing something wrong or my access version 2003 is creating problem.
i have attached the database.
Many thanks for all any help,
 

Attachments

  • help.zip
    28.2 KB · Views: 175

vbaInet

AWF VIP
Local time
Today, 05:07
Joined
Jan 22, 2010
Messages
26,374
Does the Sum show correctly on the subform?

Copy and paste what you wrote in the textbox that is on the main form.
 

sigma788

Registered User.
Local time
Yesterday, 21:07
Joined
Dec 1, 2009
Messages
40
=[mysub].[Form]![TotalSum]
where mysub is the name of subform and TotalSum is the textbox on mysub with controlsource =nz(Sum([Total]))
 

sigma788

Registered User.
Local time
Yesterday, 21:07
Joined
Dec 1, 2009
Messages
40
the subform has datasheet view and gets populated by unbound textboxes on mainform.
that is why(i think) it does'nt get sumed on subform and gives error.

any ideas how to get round this problem.
 

stopher

AWF VIP
Local time
Today, 05:07
Joined
Feb 1, 2006
Messages
2,395
There's something wrong with your forms - I think they've got themselves in a pickle.

I suggest you build your main form and subform from scratch. You should be able to use Dataview.

Note that the reference to the subform control will be:

=[Forms]![frm]![mysub].[Form]![TotalSum]

Leave the filtering and any code until you've got this fixed.

Chris
 

sigma788

Registered User.
Local time
Yesterday, 21:07
Joined
Dec 1, 2009
Messages
40
i tried another option
saved the subform recordsource as query, than sumed it and used a command button on mainform to open that query. it worked and shows the correct sum now (strange...)
 

vbaInet

AWF VIP
Local time
Today, 05:07
Joined
Jan 22, 2010
Messages
26,374
It's more like there's a problem with your table. It has experienced some form of corruption. Create a brand new table and link it back to your other tables and form. Also remember to give it a Primary Key as you currently don't have one.

I will advise that you also create brand new tables for your other tables afterwhich you can copy and paste from the old to the new.
 

Users who are viewing this thread

Top Bottom