I'm attaching the database. Also, the original call is also failing now. Which is especially weird because after I got the error with the new call, I tested the original and it worked fine. But the next time I entered an unknown name I got the same Invalid Outside Procedure error!
The Function I'm calling is this one:
Code:
Public Function AddNewArtist(NewData As String, Response As Integer, Instrument As Integer)
Dim strTmp As String
'Get confirmation that this is not just a spelling error.
strTmp = "Add '" & NewData & "' as a new performer?"
If MsgBox(strTmp, vbYesNo + vbDefaultButton2 + vbQuestion, "Not in list") = vbYes Then
'Append the NewData as a record in the Performers table.
strTmp = "INSERT INTO Artists ( LastName, FirstName, BandName, OriginalName, Instrument_id ) VALUES ('" & getLastname(NewData) & "','" & getFirstname(NewData) & "','" & getBandname(NewData) & "','" & NewData & "'," & Instrument & " )"
DBEngine(0)(0).Execute strTmp, dbFailOnError
'Notify Access about the new record, so it requeries the combo.
Response = acDataErrAdded
End If
End Function