Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    DAO Recordset as DSum domain?

    Is Access telling me I cannot use a DAO Recordset as the domain expression in a DSum function?


    (rsBefore is DAO Recordset It is currently open)

    Click image for larger version. 

Name:	000.jpg 
Views:	14 
Size:	47.4 KB 
ID:	26714
    Click image for larger version. 

Name:	001.jpg 
Views:	14 
Size:	31.8 KB 
ID:	26715

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,421
    That is correct. Dsum references a table or query object. A recordset is not an object. Why not just use a query to generate what you require?

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    That's what I'll do. How do I get the value of a field in the last record of a sorted query? (That's why I'd loaded the select into a DAO recordset to gain access to MoveLast, MoveNext, etc. type commands)

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,421
    sort it in descending order and use SELECT TOP 1

    using movefirst/last etc in a vba sub or function is the slowest possible way of doing things

    Perhaps if you explained in simple English what you are trying to do I can suggest the appropriate sql

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    No problem, Ill save the query def and let jet do the summations and use your suggestion to get the field out of the last record. Thanks for the offer.
    Bill

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 06-03-2015, 11:42 AM
  2. Access and Domain Server
    By chaddresnick in forum Access
    Replies: 3
    Last Post: 03-27-2015, 01:12 PM
  3. Replies: 2
    Last Post: 01-29-2015, 03:07 PM
  4. Domain Sum Error
    By benjaminporter.dc in forum Queries
    Replies: 1
    Last Post: 02-01-2011, 01:06 PM
  5. Group by the Emails ISP or Domain Name
    By Shakenaw in forum Access
    Replies: 7
    Last Post: 01-06-2011, 10:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums