Solved

Sum Columns in MS Office Spreadsheet Control

Posted on 2009-05-14
5
388 Views
Last Modified: 2013-11-28
I have a form (Form1)  in MS Access that contains an MS Office Spreadsheet Control titled "Spreadsheet0".  I want to add Text Boxes above the Spreasheet Control that show the total for each spreadsheet column.  So the Text Box named TextBox1 would show the total for Column A in the Spreadsheet, etc, etc.

If I was working in Excel with a Userform that contained a Text Box, I would use somthing like: WorksheetFunction.Sum(Columns(1)).  However, WorksheetFunction appears to not work with the Spreadsheet Control in MS Access.

How do I show the sum of the numbers in Column 1 of the Spreadsheet Control in TextBox1?

Thanks,
Greg
0
Comment
Question by:CascadeGeneral
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24392361
CascadeGeneral,

I think it would be far easire to Link the Excel Data into Access, then use the Access Sum() function to get the sum of the column.

Embedding spreadsheet controls will bloat the Database and will be much slower than linking the data...
If doing what you are asking is even possible.
:-O

Here is a sample.
Extract both files to your:  C:\
Root folder then open the DB, then open the frmData form.

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24392363
0
 

Author Comment

by:CascadeGeneral
ID: 24399681
So are you suggesting that I link an Access table to the MS Office Spreadsheet Control, and then sum the fields in the linked Access table?  If I understand you correctly, I like the idea.  Although I am not sure how to link a MS Office Spreadsheet Control to an Access table.

If I do understand you correctly, do you know how to link an MS Office Spreadsheet Control (embedded on an MS Access Form) to an MS Access table?  I've heard that you can link an Excel Spreadsheet to an MS Access table, but I haven't seen anthing about linking an MS Office Spreadsheet 11.0 Control.

Greg
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 24399876
My presumption may have been incorrect,
I presumed that you had an "external" spreadsheet.

You could link this external spreadsheet into Access (no "Spreadsheet Control" needed) as a Linked table.

Then make a form out of it, and use a asimple texbox and a formula to get the total.


Jeff
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24568384
;-)
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question