Hello, I'm trying to display the total records in a field in a subform. I essentially want these fields to mirror the ones at the top left of the Sesame Database Manager GUI that shows the current record (left side) and the total number of records (rightside) I have no trouble displaying the current record using @ResultSetCurrentPosition(). However, my problem lies in using @FormResultSetTotal("form"). Here is my code:
(Universal Event)
var vTotal as Int
vTotal = @FormResultSetTotal("Work")
FormFieldValue(@Layout + ":(Update)", "Total_Jobs", 0, vTotal)
What happens is that this field Total_Jobs always seems 1 record behind the actual account. For example, at the top it might show 4 total records but down at the bottom it shows 3. But when I click my previous record button:
(Universal Event)
var vPos as Int
If (@Mode() = 0) Or (@Mode() = 1)
{
vPos = @ResultSetCurrentPosition()
vPos = vPos - 1
If vPos > 0
{
ResultSetCurrentPosition(vPos)
}
}
@Play("Click")
It will sometimes correct itself and show the proper amount of records. I'm really stumped on this. I've tried adding "+1" to force it to correct itself but that in itself was buggy and not correct all the time. I've tried using different variations of the @ResultSetTotal() command and I've even tried many of the different various events to run it on. (e.g. On Form Change, On Form Entry, etc.) All to no avail. Am I missing something here or is the @ResultSetTotal() running too soon, like before the new record is actually created, thus it's information is not up to date? Not sure, but I thought I'd throw it out there, to see if I might get some feedback. Thank you for your time.