Forum Discussion
AndyBentley-7653
Aug 25, 2022Copper Contributor
Deleting records from a form in datasheet view when a sort has been applied to a combo-box.
I believe that I have found a bug in Access. I am currently running Microsoft® Access® for Microsoft 365 MSO (Version 2207 Build 16.0.15427.20182) 64-bit . To reproduce this bug do the following: ...
arnel_gp
Aug 26, 2022Iron Contributor
it is not a bug.
if you have Inner Join your tables in the query, Yes it will delete records on both tables.
- AndyBentley-7653Aug 26, 2022Copper ContributorI am not using a delete query.
I am deleting records from the form in datasheet view by selecting records using the record selector on the form and then pressing delete key on keyboard.- arnel_gpAug 27, 2022Iron Contributor
Again it is not a bug.
If you are using Join in your Recordsource in your Datasheet form, and
joining on Both PK fields (which means it will result in 1=1, relationship. Table2.ID2 Inner/Left/Right Join to Table1.ID1), then it will Delete On Both tables.
SOLUTION:
1. Do not make ID2 of Table2 as PK and Do not make Unique Index to it.
Or
2. Use Dlookup() as Control Source of your "Description" Column:
=DLookup("Desc", "Table1", "ID = " & Nz([ID2], 0))
- George_HepworthAug 27, 2022Silver ContributorActually, it turns out that you were on the right track, except the join is implicitly materialized by sorting on the combo box.