Microsoft KB Archive/175961

= ACC97: Documentation Error in "OldValue Property" Help Topic =

Article ID: 175961

Article Last Modified on 1/22/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q175961



Moderate: Requires basic macro, coding, and interoperability skills.



SUMMARY
In the sample code in the Microsoft Access 97 "OldValue Property" Help topic that reads as follows, the last line before the End Sub statement (Next ctl) is incorrect:

Sub btnUndo_Click Dim ctlTextbox As Control For Each ctlTextbox in Me.Controls If ctlTextbox.ControlType = acTextBox Then ctlTextbox.Value = ctl.OldValue End If     Next ctl End Sub

The correct code is as follows:

Sub btnUndo_Click Dim ctlTextbox As Control For Each ctlTextbox in Me.Controls If ctlTextbox.ControlType = acTextBox Then ctlTextbox.Value = ctl.OldValue End If     Next ctlTextbox End Sub

Note that the correct syntax for the last line before the End Sub statement is Next ctlTextbox, not Next ctl.

