Solved

ADO Get data from last populated record

Posted on 2006-06-09
4
161 Views
Last Modified: 2010-04-30
Hi,

I'm using DAO to connect to an access database. The DB populates a DataGrid.

How do I to retrieve the data from the last populated record. Eg if my records and fiels are populated as below, I would want to return either dd  from the A1 record. The columns will be populated with a varying amount of data...

Thanks, Dave.

A1   A2 etc etc
aa   zz
bb   xx
cc   gg
dd  hh

0
Comment
Question by:wildarmsdave
  • 3
4 Comments
 

Author Comment

by:wildarmsdave
ID: 16870507
I don't have Vb to hand at the moment. Could I use the recordset.move last to go to the last record and then then recordset.absoluteposition to determine what position the cell is and get the data from it. There must be an easier way surely?
0
 

Author Comment

by:wildarmsdave
ID: 16884508
Hmmm. This partialy works but returns the whole record, not specific fields..

ARecordset.MoveLast

MsgBox ARecordset.GetString
0
 

Author Comment

by:wildarmsdave
ID: 16890249

Got it! This seems to do what I want...

ARecordset.MoveLast
MsgBox (ARecordset.Fields("a1"))
0
 

Accepted Solution

by:
EE_AutoDeleter earned 0 total points
ID: 17026699
wildarmsdave,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Computer crashes, following error message in event manager 5 198
bit defender blocks good applications 2 94
Determine Range to Select 5 48
Export Data to Different .csv Files 26 104
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 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