I apologize, I accidentally hit the enter key, prior to writing a message and
the question was posted twice! It feels like a Monday. Sorry.
My problem is that I have a .Seek algorithm that is supposed to open a
history (ADO) recordset, find the most recent entry for a particular serial
number, grab a field value and then update the same field in a different
recordset for the same serial number. The history maintains the number of
times a piece of equipment has been used and increments each time a entry is
made in the history table. For this reason when the main table is viewed on a
data entry form the "usage count" must be calculated dynamically being
"pulled" from the history table. My .Seek seems to be working properly but
because the history recordset seems to open by default as sorted ascending by
my indexed field, the serial number, the records are not in the order in
which they were created.
My idea was to use a .Seek, as I have done for many other subs in this
program, to find the last entry in the history for a seral number by using
rsHistory.Seek rsMainData("Serial Number"), adSeekLastEQ. This should find
the last instance of that serial number in the history recordset. BUT because
the history recordset is not sorted by the autonumber field (Entry #) the
..Seek is not returning the desired values.
I attempted to just add a simple .Sort by Entry # on the histry recordset
but I keep getting errors like "Current provider does not support the
necessary interface for Index functionality".
I tried a .Sort and a mySQL ORDER BY with the same results.
My tables are local, I have the Serial Number set to Indexed YES duplicates
allowed.
I have had a few responses with alternate methods to do what I need to do
but have not had success with those. I still yet have not had a clear
response from any contributor about my actual question regarding how to do a
..Sort and then a .Seek in the same ADO recordset. Any ideas? Any help is
greatly appreciated.