Results 1 to 2 of 2
  1. #1
    runner231 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jun 2018
    Posts
    6

    Cannot delete records in subform, but can creat new records in subform

    I have a subform linked to one mainform

    The row source of the subform is base on a table.



    The row source of the mainform is based on a query(should be read only query) because sum(), group by clause, join are used in the query.

    The common identifier between the table and the query is an ID

    Therefore, the link master link fields is ID and link child fields is ID.

    The subform is in datasheet view.

    I am able to insert new record in the subform, however, I can’t delete the record in the subform. When I insert the new record in the subform, the record was inserted into the table.

    I “right click” on each row, then select “Delete Record”. Although the record is “deleted”, the record was still there when I reopened the form. I also checked the table to confirm the record was still in the table. I also tried the Delete key, but the records also can’t be deleted.

    Sometimes, the “Delete Record” is greyed out when I “right click” on the row. And sometimes, it is not greyed out.

    If I run the subform alone, the record in the subform can be deleted. The record was removed from the table when I checked the table.

    May I know what could be the reasons why can’t I delete the record even though I can insert a new record in the subform.

    Thank You.
    Last edited by runner231; 07-11-2018 at 04:03 AM.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,776
    I have read that main form properties such as Allow Deletions = No, or a main form query property being Snapshot etc., can propagate to a sub form but have not experienced this. If you can delete from the subform when opened directly, the inference is that there is something about the main form that is the cause. If you're not getting an error message and have not turned off warnings in code, then the only suggestion I have would be to copy the forms and alter the main form copy so as to base it on an updatable query and see what happens. If that solves it, maybe your main form source could calculate those fields on the form instead of in the query. If you are getting an error message, it might help to know what it is.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Delete multiple records in a subform
    By gaker10 in forum Forms
    Replies: 31
    Last Post: 02-27-2019, 04:08 AM
  2. Replies: 2
    Last Post: 05-29-2018, 07:39 PM
  3. Replies: 4
    Last Post: 07-03-2013, 10:02 AM
  4. Replies: 2
    Last Post: 02-12-2013, 11:23 AM
  5. Replies: 12
    Last Post: 08-30-2011, 03:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums