bradmaunsell
Programmer
This should be simple but .....
I am having trouble refeshing records on a form - under certain conditions.
I have a simple form with the record source set to a single table (tblGeneralledger) and set for continuous forms.
Each line on the form is a record and the footer adds the total debits and total credits.
All is well except when a change a DR or CR amount got directly to a "Finalize" button without clicking some other record first.
If I click the "Finalize" button a second time, then all is ok.
I have tried refresh, requery, goto first record, etc all with no solution.
Here is the code.
Private Sub cmdFinalize_Click()
DoCmd.RunCommand acCmdRefresh
ValidateDataEntry
If ValidOK = False Then Exit Sub
UpdateGeneralLedger 'Append records to tblGeneralLedger
End Sub
Sub ValidateDataEntry()
If CDbl(Me.Total_DR) <> CDbl(Me.TOTAL_CR) Then
MsgBox "Total DR not equal to Total CR", vbOKOnly, "Cannot Proceed"
ValidOK = False
Exit Sub
End If
'etc, etc
End Sub
If I change an amount to cause out-of-balance, I do not trigger a msg until I click the "finalize" a second time. If I go to the menu bar > Records > Refresh before clicking the "finalize", it works.
Apparently, I am not refreshing my screen data correcly or timely.
Any help wil be greatly appreciated.
Brad
South Burlington, VT
I am having trouble refeshing records on a form - under certain conditions.
I have a simple form with the record source set to a single table (tblGeneralledger) and set for continuous forms.
Each line on the form is a record and the footer adds the total debits and total credits.
All is well except when a change a DR or CR amount got directly to a "Finalize" button without clicking some other record first.
If I click the "Finalize" button a second time, then all is ok.
I have tried refresh, requery, goto first record, etc all with no solution.
Here is the code.
Private Sub cmdFinalize_Click()
DoCmd.RunCommand acCmdRefresh
ValidateDataEntry
If ValidOK = False Then Exit Sub
UpdateGeneralLedger 'Append records to tblGeneralLedger
End Sub
Sub ValidateDataEntry()
If CDbl(Me.Total_DR) <> CDbl(Me.TOTAL_CR) Then
MsgBox "Total DR not equal to Total CR", vbOKOnly, "Cannot Proceed"
ValidOK = False
Exit Sub
End If
'etc, etc
End Sub
If I change an amount to cause out-of-balance, I do not trigger a msg until I click the "finalize" a second time. If I go to the menu bar > Records > Refresh before clicking the "finalize", it works.
Apparently, I am not refreshing my screen data correcly or timely.
Any help wil be greatly appreciated.
Brad
South Burlington, VT