A visual switch displays a series of text or picture items. Clicking the field displays the next item in the series.
The BeforeUserChanged and AfterUserChanged events run each time the user selects an item a visual switch. All other VBA field events function normally for a focusable visual switch field.
VBA uses numeric values when referencing visual switch fields. The numeric value corresponds to the currently-displayed item in the series, starting with 1 and incremented by 1. For a visual switch with two pictures in the series, the first picture in the list has a value of 1 and the second has a value of 2.
The following example expands the scrolling window in the Invoice Entry window when the window initially opens:
Private Sub Window_BeforeOpen(OpenVisible As Boolean) ScrollingWindowExpandButton2 = 2 End Sub