Link to home
Start Free TrialLog in
Avatar of wildarmsdave
wildarmsdave

asked on

ADO Get data from last populated record

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

Avatar of wildarmsdave
wildarmsdave

ASKER

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?
Hmmm. This partialy works but returns the whole record, not specific fields..

ARecordset.MoveLast

MsgBox ARecordset.GetString

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

ARecordset.MoveLast
MsgBox (ARecordset.Fields("a1"))
ASKER CERTIFIED SOLUTION
Avatar of EE_AutoDeleter
EE_AutoDeleter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial