I've been using the Access "On Not In List" event for a long time. It allows you to limit the items in your combo box to a particular list, but allows the user to add an item to combo's record source on the fly if they want to enter something that isn't already there. You set the "Limit To List" property of the combo box to Yes, but then you put some code behind the "On Not In List" event. Intermittently, I get a situation in Access 2016 where this doesn't seem to work. I get the standard "The item is not in the list." error when trying to enter a new item, without my code-behind logic being seen and called. What's up?
相关问题
- Importing data from MS Access db to PostgreSQL db
- DoCmd.TransferSpreadsheet is not recognizing works
- Is there a way to apply theme on converted access
- How to programmatically convert Access 1997 .mdb t
- Multiple (left, cross?) JOINs in MS Access
相关文章
- COALESCE, IFNULL, or NZ() function that can be use
- CurrentDb.RecordsAffected returns 0. Why?
- How to embed ms-access forms in C# module?
- Sleep Lib “kernel32” gives 64-bit systems error
- How to destroy an object
- Close all VBE windows (MS Access, VB for Aplicatio
- Compiling an Access 2007 accdb into accde
- MS Access VBA: turn query results into a single st
After banging my head against the wall for a long time, I believe this is bug in Access 2016 and I think I stumbled on a fix. I set the form's RecordSetType property to Snapshot, closed and saved form, reopened the form in design view, set the RecordSetType property back to Dynaset. This seems to have cleared up the problem. I have no idea why.
But since I'm here. . . some additional details: In the code-behind for each control I use code like this:
This type of subroutine gets created automatically behind the "On Not In List" event, when you click on the 'code builder' option. I have mine call a utility function that I wrote a long time ago. ("RU" refers a code library.)
The function returns an intrinsic Access integer constant that gets passed straight back to Access to handle.
The inside of that routine looks like this:
All the all-caps items in the code above are Access intrinsic constants.