Thanks for the quick response. I found the problem. The code was on a form. I noticed that the SortBy property of that form was blank. Setting SortBy to "Date" (the sorted field in the table) seems to have solved it. Since there was no such issue two weeks ago, wonder what could have erased the...
When I run the following code, instead of reading values from the last record, the variables are being assigned field values from a much earlier record (records are sorted by date). It seems to randomly select the record to read from! This used to work correctly. I have verified that...