+ Reply to Thread
Results 1 to 8 of 8

Deleting lines in an access table

  1. #1
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Deleting lines in an access table

    I have a table in access and I want a code that will automatically send an email if someone tries to delete the any lines within the table. as i know it ask permission to send emails if the person clicks no then I don't want it to delete the line. Basically it only deletes the line if employee allows email to be sent.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Deleting lines in an access table

    I am confused by your explanation. Are you able to supply an example of what you are looking to do. When you say line are you referring to a complete record in a table or just a particular field with in a record. The term "line" is not an access term so I am not sure what you are referring to.

    It is a poor development practice to allow users to access tables directly. All work should be performed within forms to maintain integrity. With accessibility to tables it is easy to modify and change things accidentally.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Deleting lines in an access table

    Sorry for the confusion as I am still a novice. when I said line i did mean record. The majority of people do not have access to the tables but a hand full of people do, and occasionally they delete records. What I need is when they attempt to delete a record it will automatically send a email to me and some others. if they decline the email (because my researsh says outlook ask permission) then record does not delete.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Deleting lines in an access table

    I believe you have an issue here. Firstly, as I indicated earlier, users should not have direct access to tables. Second, it is generally a bad practice to delete records in a database. You should alternatively have a field that makes a record inactive. In this manner, no data is ever lost. Just good database practices. I believe you have an education process that needs to be invoked.

    Others may have a solution for you, but I know of no way to trigger an email from action that takes place directly in a table. If you do not receive a viable solution in this sub-forum, you may wish to engage the Commercial Services portion of this forum. It is a pay for results sub forum.

  5. #5
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Deleting lines in an access table

    okay 2 questions, first does the code i seek exist? and secondaly how do you creat a field to make and entry inactive?

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Deleting lines in an access table

    Open your table in design view. Add a new row (field) to the table. Give it a name ie. Active or Inactive and make it a Y/N Boolean Field. Add this to your Form and then in your queries, you can set the field to Y or N to exlcude or include whichever way you go (Active or Inactive).

    As to your code question. Anything of this type would have to be developed. I have never seen any code driven directly from a table change. I could be wrong on this. I will ask other Forum experts to look at this issue and determine if they have a solution.
    Last edited by alansidman; 11-19-2014 at 10:53 AM.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Deleting lines in an access table

    I have done a little bit of research

    https://support.office.com/en-us/art...rs=en-US&ad=US

    I have no experience writing Macros in Access. They are different from VBA. I use only VBA.

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Deleting lines in an access table

    Do you not have normal Triggers in Access?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Deleting Lines getting #REF!
    By Myrkk in forum Excel General
    Replies: 3
    Last Post: 03-31-2011, 04:25 PM
  2. Deleting all records in a access database table from Excel
    By Dave31 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2008, 02:18 PM
  3. deleting lines
    By stevesunfold in forum Excel General
    Replies: 19
    Last Post: 07-14-2007, 05:52 PM
  4. Import lines from Access table.
    By 101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2007, 10:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1