I have a main switchboard form with a list box. The user needs to be able to click a command button to create a new record in a table with a new "SongRef" (the autonumber key for the table) Then it should open a "frmSongs" form that has a RecordSource of the "tblSongs" (the table where all the information from the songs is located) based on the new record that was just created. This is what I have already, I just don't know how to create a new record
Private Sub cmdAddSong_Click()
On Error GoTo Err_cmdAddSong_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmSongs"
DoCmd.OpenForm stDocName, acNormal, "", "SongRef = Forms!frmSwitchboard!lstSongs", , acNormal
Exit_cmdAddSong_Click:
Exit Sub
Err_cmdAddSong_Click:
MsgBox Err.Description
Resume Exit_cmdAddSong_Click
End Sub
I know it should be simple but I don't where to start. Any help would be greatly appreciated. Thanks.
Private Sub cmdAddSong_Click()
On Error GoTo Err_cmdAddSong_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmSongs"
DoCmd.OpenForm stDocName, acNormal, "", "SongRef = Forms!frmSwitchboard!lstSongs", , acNormal
Exit_cmdAddSong_Click:
Exit Sub
Err_cmdAddSong_Click:
MsgBox Err.Description
Resume Exit_cmdAddSong_Click
End Sub
I know it should be simple but I don't where to start. Any help would be greatly appreciated. Thanks.