Color scheme: Light
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » Data editors » WklButtonEdit

WklButtonEdit

WklButtonEdit is a text box with a button on its right, for values that come from a dialog or a check: a Windows account you look up, a connection you test, or a secret you change. You bind it like an Access text box, and it's saved with the record.

Get started

None

Common tasks

Visual aid

+- frmIdentity: Form View -------------------------------------------+
|  Windows account  [ DOMAIN\miller                  ][ … ]          | 1   2
|  Secret           [ ●●●●●●●●●●●●                   ][Change…]      | 3
+--------------------------------------------------------------------+
RegionMeaning
1The text, bound through Control Source just like a text box
2The button (ButtonCaption “…”); a click, F4, or Alt+Down raises ButtonClick
3A secret: PasswordMask shows the password character, and TextEditable = False lets only the button's procedure change it

Key features

  • Binds like a text box: Access writes the field to Value whenever the record changes; what the user types marks the record as dirty and is saved with it; empty text is Null; and Esc undoes the user's change.
  • Access controls editing: a locked control, or a form that doesn't allow edits, rejects the first keystroke.
  • The button: ButtonClick fires for a click, F4, Alt+Down, a screen reader's Invoke action, or ClickButton from code. The button isn't a tab stop, so the focus stays in the text.
  • Secrets and fixed values: PasswordMask, TextEditable = False, and MaxLength.
  • Screen readers announce a group named by Caption that contains a real edit field (a password field with PasswordMask) and a real button named by ButtonText.

Core concepts

Access saves the field, just as for a text box. The control reports each change to Access, which marks the record as dirty and copies the control's value to the field when the record is saved. A value set in code (Value) is only displayed; to save a value your dialog returned, set the field as well.

The button belongs to the text. It's drawn inside the text box frame and never takes the focus, so users can keep typing after a click, just as with the Build button [...] in the property sheet.

Access keeps its own properties. Enabled, Locked, Visible, TabStop, and the tooltip are the standard properties that Access gives every control.

Administration

Troubleshooting

None

For developers

None

en/wiki/msaccess/comctl/data-editors/buttonedit/start.txt · Last modified: by Wolfgang van der Stille