Results 1 to 5 of 5
  1. #1
    rhubarb is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2011
    Posts
    76

    Solutions for Editing/Deleting from an existing Form

    Hello all,



    I am trying to find a solution for editing and deleting fields with my current access project. Currently, I can open frmTickets and enter data, but there are a few pre-requisites: one being tblCustomers and tblEmployees need data in them to pull from.
    That part is fine even with the pre-req's. The issue is when a user needs to edit or delete an existing ticket. The only way to do that is to first delete the devices associated with the ticket (tblDevicetoTicket), then delete the ticket itself (tblTickets).
    This is obviously not ideal but the requirements were to have multiple devices mapped to a single ticket and to be able to report on them.

    One solution, I thought, was to add navigation buttons to the frmTickets but it has combo boxes based on queries as well as a subform and I haven't been able to get that to work.

    Does anyone have suggestions? I've attached a stripped down but functioning version of the database.

    Thanks for any help!
    Attached Files Attached Files

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    if you set your relationship between tickets and devices to ensure referential integrity and tick cascade deletes then deleting the ticket will delete the associated devices

  3. #3
    rhubarb is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Sep 2011
    Posts
    76
    Thanks for the suggestion. That simplifies the effort of deleting from the back-end but I'd like to set something up so that the user can do this from the form. I'm getting the feeling that the way it is currently set up doesn't offer many options.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    What Ajax is saying does work on the form for users. You add a Delete button (of if they select a record and hit delete key) to your main form and when they delete the main record, if you have referential integrity set with cascade deletes, it will automatically delete those associated records. That is the cleanest way I think to avoid orphaned records.

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    As Bulzie says - will work if you delete the ticket on a form or on a query, via vba code, whatever - the relationship is defined at the table level, it doesn't care where the instruction to delete comes from

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

Similar Threads

  1. Replies: 2
    Last Post: 12-29-2015, 10:06 PM
  2. Replies: 11
    Last Post: 10-22-2014, 07:56 AM
  3. Deleting existing recod
    By guilpter in forum Import/Export Data
    Replies: 4
    Last Post: 04-27-2013, 02:21 PM
  4. Multiuser Access Solutions?
    By GaryE in forum Access
    Replies: 4
    Last Post: 04-16-2013, 06:15 AM
  5. Editing Existing Report
    By wsuspte in forum Reports
    Replies: 1
    Last Post: 02-11-2009, 02:53 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