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
AddTokenis rejected, just as a subform rejects rows until its parent record exists. - Locked or not editable. The control's
Lockedproperty is Yes, or the form'sAllowEditsis No. - A rejected value. The value doesn't match
Pattern, isn't among the suggestions whileAllowFreeTextis False, or is already a token.ErrorTextgives 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.
DataErrorreports the message from Access or the driver.
Resolution
- Save the parent record first (for example, with
Me.Dirty = Falseafter the user fills in the first field); the box accepts input as soon as the record has a key. - Check the control's
Lockedproperty and the form'sAllowEditsproperty. - After a rejected
AddToken, readErrorTextor handleDataErrorto see which rule rejected the value. - To allow values that aren't in the list, set
AllowFreeTextto True, or add the value toSuggestionSourceorSuggestionList.
Related topics
en/wiki/msaccess/comctl/troubleshooting/tokens-cannot-be-added.txt · Zuletzt geändert: von Wolfgang van der Stille