Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How referesh records

Status
Not open for further replies.

bradmaunsell

Programmer
May 8, 2001
156
US
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 &quot;Total DR not equal to Total CR&quot;, vbOKOnly, &quot;Cannot Proceed&quot;
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 &quot;finalize&quot; a second time. If I go to the menu bar > Records > Refresh before clicking the &quot;finalize&quot;, it works.

Apparently, I am not refreshing my screen data correcly or timely.

Any help wil be greatly appreciated.

Brad
South Burlington, VT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top