+ Reply to Thread
Results 1 to 2 of 2

When record is created/deleted in Table1, then add/delete record to Table2

  1. #1
    Forum Contributor michellepace's Avatar
    Join Date
    10-28-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    127

    Question When record is created/deleted in Table1, then add/delete record to Table2

    Hello,

    When a record is created/deleted in Table1, then add/delete record to Table2

    Intended functionality:
    1. The TRADE table and TRADE COMMENTS table must always have the same number of rows
    2. When a new trade record is created in the TRADE table, it must also be created in the TRADE COMMENTS table
    3. When a trade record is deleted in the TRADE table, it must also be deleted in the TRADE COMMENTS table
    4. I would like to protect the sheet which contains the TRADE COMMENTS table to prevent the user from ever manually deleting or adding rows (thereby avoiding the slew of bugs which occur there after). However when I protect the sheet my Macro will no longer run... to code against all these bugs things started getting really complex so it made me think - - is there not a simpler way to do this?!

    I feel like I have completely over designed the solution with the vba code I have written. Again, all I need is for when a record is added to the TRADE table, a corresponding record is added to COMMENTS table. I wanted to have "TradeID" in the TRADE COMMENTS table as a dynamic structured reference to the "TradeID" column in the TRADE table. I thought that would be a nice easy way to do things... but I'm not sure this is even possible.

    Does anyone have any ideas for a more eloquent solution to satisfy my requirements?
    Table1 dynmically maintains rows to Table2.xlsm

    Thanks in advance,
    Michelle

  2. #2
    Forum Contributor michellepace's Avatar
    Join Date
    10-28-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    127

    Lightbulb Re: When record is created/deleted in Table1, then add/delete record to Table2

    Hi there,

    In case this may be helpful to anyone else I have posted a solution excel file to the above problem. It took me a while to figure out (and a lot of help from this forum) so here's hoping the solution may be useful to somebody else:

    http://www.excelforum.com/excel-form...ml#post4250146

    Cheers,
    Michelle

+ 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. [SOLVED] Displaying a column from table2 based on a filter in table1
    By FVMLABOLG in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-06-2015, 04:58 PM
  2. Copy TABLE1 ROW from one sheet to TABLE2 LAST ROW in another sheet
    By jigneshwaghela07 in forum Hello..Introduce yourself
    Replies: 0
    Last Post: 06-01-2014, 12:56 PM
  3. Replies: 1
    Last Post: 11-16-2012, 09:25 AM
  4. How to copy Table2 columns in to Table1 ?
    By bsaimsc in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2012, 07:13 AM
  5. Command Buttons for Viewing Record, Next Record and Previous Record
    By david1987 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2012, 06:30 AM
  6. Replies: 1
    Last Post: 01-17-2012, 10:47 AM
  7. Replies: 0
    Last Post: 01-17-2011, 07:13 AM

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