I have a subform that contains a table (in datasheet form). If I add a new record to the table from within the subform, I need the table to automatically enter data in a field and also need to add a record to a second table. I'm not sure how to make that all happen (or even if this question is more properly about forms or queries or something else).
There are three relevant tables (these are used to catalog my album collection, btw):
LPs
lps_id, album_title, artist_id
Songs
songs_id, song_title, artist_id
LPContents
lpcontents_id, song_id, lp_id
The main form displays a single album.
The subform displays all songs contained in that album (as indicated by LPContents).
What I need to do is: If I add a new song record in the subform, I need Songs.artist_id to be set to LPs.artist_id for the current album, and I need LPContents to have a new record with LPs.lps_id and the just-added songs_id.
I would think I would want to trigger these updates on an event, but none of the events look like what I need, which would be called something like OnRecordAdded.
I could write something in VBA to do the updates if I could figure out a way to trigger it when a song is added, although if there's some simpler way than VBA I'd like to hear about it.
I hope that's clear. Thanks.