I have an Access form bound to linked view called vwBudgetEntries
from SQL Server. The form contains a combo box bound to a field called SubcodeID
which is short text and has the following properties:
Meanwhile, the row source of the combo box pulls a unique list of all subcode id's, including one where it's an empty string. For some reason, however, selecting this option throws the following error:
For the life of me, I can't figure out why. The value should be empty string, not null. If I change the combo box to a textbox and enter ""
, the update is accepted without any errors.
I've done what research I can and, so far, I've only found 2 workarounds:
- Change the field properties to allow null, then replace null values with an empty string after the control updates.
- Trap the error in the form_error event, undo the update and supply the value using VBA.
Neither workaround is ideal. Can someone explain why this error is occurring in the first place and what I might do to fix it?
1条答案
按热度按时间sulc1iza1#
除了非常特殊的情况之外,应该避免存储空字符串,否则你会遇到类似这样的问题。
SubcodeID
的未知值选择存储 Null