?
Solved

VBA Datasheet view Ms Access how to reference the total row cells

Posted on 2013-05-31
6
Medium Priority
?
2,922 Views
Last Modified: 2013-06-09
I am trying to dynamically select columns in the new feature of Datasheet view. total row and turn on or off total row plus change the aggregation selection. Any help would be helpful.
0
Comment
Question by:ahf50
[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
  • 3
  • 2
6 Comments
 
LVL 85
ID: 39211768
I don't believe you can get that data. You'd have to instead create your own Sums in code, either by using a Recordset or by using one of the Domain Aggregate methods (like DSum).
1
 

Author Comment

by:ahf50
ID: 39217526
I found the properties in VBA but I am not sure how to change them.
in the Recordset.properities(38) = TotalsRow (true or False)
in the Recordset.Fields(0).Properties(27) = AggregateType
   using 0 = sum
currently Read only..
Does anyone know how to set the properties of a form's query. on open or on current event.
0
 
LVL 85
ID: 39217722
I don't have a clue, but you can't do much with the attributes ... all that does is tell you the capabilities of the object (in this case, your recordset).

Perhaps others might have better insight ...
0
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 

Accepted Solution

by:
ahf50 earned 0 total points
ID: 39219978
Ok I figured it out.. you can use
in design mode of the form.
me.formname.form.recordset.properties("Totalrow") = True
for this part open the form in design mode and enable the total row using the method msdn and microsoft says to do.

now if you want to set the aggreation at run time. you can.
on form open event..
me.controls("fieldname").Properties("AggregateType") = 0 gives you Sum
but you can use -1 to turn it off.
1 give you the next one in the list.
any got this to open a form and apply sum to the fields that I wanted it to be applied.
1
 
LVL 48

Expert Comment

by:Dale Fye
ID: 39220134
ahf50,

Were you able to determine how to reference the value in those columns of that Totals row?
0
 

Author Closing Comment

by:ahf50
ID: 39232745
I found the solution before anyone came up the answer..
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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…
Suggested Courses

752 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