Set the value of a property in response to an event by using Visual Basic

Set the value of a property in response to an event by using Visual Basic

  1. Create an event procedure for the event.

    How?

  2. Add an assignment statement to the procedure by typing the identifier for the property whose value you want to set, an equal sign (=), and the value you want to assign.

    To refer to the property of a control on the current form, type the Me keyword followed by the ! operator, the name of the control, the . (dot) operator, and the name of the property. For example, the following statement assigns the value False to the Visible property of the DateDue control on the current form:

    Me![DateDue].Visible = False

    To refer to the property of a control on a different form, type the control's full identifier. For example, the following identifier refers to the Visible property of the DateDue control on the ShipForm form:

    Forms![ShipForm]![DateDue].Visible

For more information about referring to a property, click .

For an example of setting the value of a property in response to an event, click .