Solved

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

Posted on 2013-05-31
6
2,622 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
  • 3
  • 2
6 Comments
 
LVL 84
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 84
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unrecognized Database Format 8 93
field number type in access tabledefs fields 5 19
ms/access vba - how to wait for a form to close 2 17
access 7 25
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now