ACC: Using the Change Event to Display the Current Value

Last reviewed: April 2, 1997
Article ID: Q114553
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0, 97

SUMMARY

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

To refer to a control's current value during a Change event, use the control's Text property.

MORE INFORMATION

You can use a control's Text property to refer to the control's current value during a Change event. For example, to display the current value of a field called txtExample in the title bar while you are typing in a text box bound to that field, create the following Change event procedure for the text box:

   Sub txtExample_Change ()
      Me.Caption = Me!txtExample.Text
   End Sub

NOTE: You must use the Text property to refer to the text in the field before it is committed. In the above example, if Me!txtExample is used instead of Me!txtExample.Text, the committed value will be displayed in the title bar instead of the current value.

REFERENCES

For more information about the Change event, search the Help Index for "Change event," or ask the Microsoft Access 97 Office Assistant.

For more information about the OnChange property, search the Help Index for "OnChange property," or ask the Microsoft Access 97 Office Assistant.


Keywords : FmsEvnt kbusage
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.