Access 2010 - Filter to 0 adds record
Posted on 2013-12-03
I have a complex form with a few subforms.
The form is based on a Dynaset - a linked Table.
It has two unbound combo boxes at the top for selection.
If the user selects something from the two boxes, data is filled and the user can add/edit/.
If the user then makes another selection, the previous data needs to be "cleared" from the form until the selection is totally completed (both CBOs filled in). In order to do this I set a filter to a primary key = 0 and me.filter true. There is no record with a 0
This works great for clearing the detail without affecting any existing records.
The only problem is that as soon as I issue the me.filter = "<primary_key>=0", a new record is added. The only solution I can come up with is to delete the blank record immediately or upon exit.
This is obviously not an optimum solution.
Anyone have ideas?
(the form is complex, so the above description will have to do...)