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 +--------------------------------------------------------------------+
| Region | Meaning |
|---|---|
| 1 | The text, bound through Control Source just like a text box |
| 2 | The button (ButtonCaption “…”); a click, F4, or Alt+Down raises ButtonClick |
| 3 | A 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
Valuewhenever 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:
ButtonClickfires for a click, F4, Alt+Down, a screen reader's Invoke action, orClickButtonfrom code. The button isn't a tab stop, so the focus stays in the text. - Secrets and fixed values:
PasswordMask,TextEditable = False, andMaxLength. - Screen readers announce a group named by
Captionthat contains a real edit field (a password field withPasswordMask) and a real button named byButtonText.
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
Related topics
None