Thanks
@arnoldg.
Now it works to add titles from the combo box to new vinyl records.
But if the title is not in tbl_music, I want to be able to enter it in the combo box and that it is then saved in tbl_music at the same time as it is added to the vinyl record in the table tbl_music_record.
If you download this new version of the database, I have in post 1 in frm_record2 a single with Stevie Wonder.
The A side is Part Time Lover and the B side should be the same song but instrumental.
I want to be able to enter the name of the B side with the extension "Instrumental" and that it is saved both in tbl_musik and in tbl_music_record.
Guess some code is required.
I have tested with this but can not find the right code to get record_artist_ID which must be stored at the same time.
Private Sub music_record_music_NotInList(NewData As String, Response As Integer)
Dim strTmp As String
'Get confirmation that this is not just a spelling error.
strTmp = "Add '" & NewData & "' as a new titel?"
If MsgBox (strTmp, vbYesNo + vbDefaultButton2 + vbQuestion, "Not in list") = vbYes Then
'Append the NewData as a record in the music table.
strTmp = "INSERT INTO tbl_music (music_titel)" & _
"SELECT" "" & NewData & "" "AS music_titel;"
DBEngine (0) (0) .Execute strTmp, dbFailOnError
'Notify Access about the new record, so it requeries the combo.
Response = acDataErrAdded
End If
End Sub
Once again, I trust in you out there!
Leif