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 CurrentRecord is indeed the last record in the table. I added the Pause in case it needed more time to read the last record.
Here is code...
DoCmd.GoToRecord , , acLast 'go to end of table
MsgBox (CurrentRecord)
Pause (4) 'wait 4 seconds
mcurCaBal = [CashBalance] ' load field values into variables
mcurChBal = [CheckBalance]
mcurOBal = [OfficeBalance]
mcurBBal = [BankBalance]
mcurGTot = [GrandTotal]
Here is code...
DoCmd.GoToRecord , , acLast 'go to end of table
MsgBox (CurrentRecord)
Pause (4) 'wait 4 seconds
mcurCaBal = [CashBalance] ' load field values into variables
mcurChBal = [CheckBalance]
mcurOBal = [OfficeBalance]
mcurBBal = [BankBalance]
mcurGTot = [GrandTotal]