I have a request that's probably a little of the box.
Right now, I have table 1 with (among others): ParentID (primary key), Parent Name, Daughter Count. I also have table 2 with (among others): DaughterID (primary key), ParentID, Daughter Name. Parent Name in table 1 might be W-1, daughter count might be 4, and daughter Name might be W-1A. Parent ID in table 2 is just a 1, 2, etc that has a relationship with parent ID from table 1.
I want to have a macro that automatically populates "x" number of daughters in daughter name based off of the parent's daughter count once a field in table 1 is updated. The resepective parent ID should also populate next to each item. For example: W-1 (parent ID = 1) can make 4 daughters. Once checked it should create four 1's in parent ID of table 2 and W-1A, W-1B, W-1C, and W-1D in each of the daughter name fields.
I have a macro that works and makes a new entry after each update, but I don't know how to change it to accomindate multiple entries based off of the field or add the appropriate alpha character. I wanted to get into VBA to try and modify the code, but the convert macro to VBA is greyed out in design mode for my macro. This is my current macro:
If Updated("Mated") Then | Create a Record In tblTable2 | SetField | Name: tblTable2.ParentID | Value: tblTable1.ParentID | SetField | Name: tblTable2.DaughterName | Value: tblTable1.ParentName |
Any help is greatly appreciated! Thanks