Barvna shema: Temna
Trenutno dejavna stran: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » WKL Forms Object Library troubleshooting » Tokens cannot be added to the token box

Tokens cannot be added to the token box

Environment

WklTokenBox 1.33 and later, in Access forms (ACCDB, ACCDE, runtime).

Cause

The box rejects input when a token row can't be written or would be invalid:

  • A new record that hasn't been saved yet. A linked box writes its rows with the key of the form's record. A record that hasn't been saved doesn't have a key yet, so the input is read-only and AddToken is rejected, just as a subform rejects rows until its parent record exists.
  • Locked or not editable. The control's Locked property is Yes, or the form's AllowEdits is No.
  • A rejected value. The value doesn't match Pattern, isn't among the suggestions while AllowFreeText is False, or is already a token. ErrorText gives the reason.
  • The table rejects the row. A rule, a required field, or a duplicate in the child table, or a data service that rejects the insert. DataError reports the message from Access or the driver.

Resolution

  1. Save the parent record first (for example, with Me.Dirty = False after the user fills in the first field); the box accepts input as soon as the record has a key.
  2. Check the control's Locked property and the form's AllowEdits property.
  3. After a rejected AddToken, read ErrorText or handle DataError to see which rule rejected the value.
  4. To allow values that aren't in the list, set AllowFreeText to True, or add the value to SuggestionSource or SuggestionList.
en/wiki/msaccess/comctl/troubleshooting/tokens-cannot-be-added.txt · Zadnja sprememba: uporabnika Wolfgang van der Stille