The following code returns not the first, but the last record:
Set db = CurrentDb()
Set tblspec = db.OpenRecordset("tblPIDspec")
tblspec.MoveFirst
MsgBox tblspec("ID")
The MsgBox shows "10" because the Table includes 10 records.
How ist this possible?
thx.
Thomas
Jason Lepack - 02 Mar 2007 21:24 GMT
When you use a table as a recordset it is ordered by it's placement on
the hard-disk. It will be ordered based on whatever order it went
into the table. If you want it to be ordered by ID then set your
recordset to this:
Set tblspec = db.OpenRecordset("SELECT * FROM tblPIDspec ORDER BY ID")
> The following code returns not the first, but the last record:
>
[quoted text clipped - 8 lines]
> thx.
> Thomas