Results 1 to 4 of 4
  1. #1
    Dega is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Calgary, AB
    Posts
    73

    Query button

    Hi,

    I attempted to use the button option in design view to delete the current record that is the present view on the form.

    Let's say tblCustomerID = 90 is the present view on the form. That is the record I wish to delete as well as all other information in tblBookings and tblGroup which have the customerID.

    What is happening is that the records in tblGroup are being deleted and nothing else.

    This standard form is based upon tblCustomers which includes one row from tblGroup.GroupName. (tblGroup has GroupName, GroupID, and CustomerID)

    tblBookings is a subform dragged from the table workspace.



    Can someone tell me if I need to create a SQL query instead of a macro, and how do I associate the record to be deleted with the present form view?

    Thanks

  2. #2
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    In your Relationships you need to Enforce Referential Integrity and tick Cascade Deletes.

    But I do advise against this as it is too easy to delete by mistake.

  3. #3
    Dega is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Calgary, AB
    Posts
    73
    Thanks for the reply,

    The one-to-many relationships are there along with the Enforce Referential Integrity and Cascade Update Related Fields and Deletes. Don't know why it does not work and why it points to the tblGroups.

    Would subform organization point the focus of the update/delete actions to this table?

    It seems most are against deleting records so can you suggest how I would change the customer record to active/cancelled status which would refect those records (Cascade) in other tables.

    Can I use a option list that would show "active" with value of 1 and another "cancelled" with a value of 0.

    Something like that.

    Thanks

  4. #4
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Without seeing your actual Database I can't say for sure why your deletes are not working properly. I do feel that it is a problem with the relationships.

    << Can I use a option list that would show "active" with value of 1 and another "cancelled" with a value of 0. >>

    Yes you can do that but make sure the default value is True.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-20-2010, 12:54 PM
  2. Filter button
    By tomeem in forum Access
    Replies: 0
    Last Post: 08-28-2009, 12:50 AM
  3. Command Button Help!
    By arthura in forum Programming
    Replies: 3
    Last Post: 06-30-2009, 12:55 PM
  4. Add/Delete Button
    By ocemy in forum Forms
    Replies: 1
    Last Post: 03-29-2009, 08:08 PM
  5. add a print button
    By gromit95 in forum Forms
    Replies: 0
    Last Post: 08-13-2008, 07:28 AM

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