Mislim da sam resio dodavanjem ovog koda na event not on list
Code:
Private Sub cboProizvodID2_NotInList(NewData As String, Response As Integer)
On Error GoTo cboProizvodID2_NotInList_Err
Dim intAnswer As Integer
Dim strSQL As String
intAnswer = MsgBox("Artikal " & Chr(34) & NewData & _
Chr(34) & " se ne nalazi na listi." & vbCrLf & _
"Da li zelite da ga dodate u listu? " & vbCrLf & "" _
& "Ukoliko se artikal vodi kao usluga " & vbCrLf & "" _
& "ne zaboravite da ga oznacite kao uslugu! " _
, vbQuestion + vbYesNo, "AAA")
If intAnswer = vbYes Then
strSQL = "INSERT INTO tblProizvodi([naziv_proizv]) " & _
"VALUES ('" & NewData & "');"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
MsgBox "Novi artikal je dodat u listu." _
, vbInformation, "AAA"
Response = acDataErrAdded
Else
MsgBox "Molim odaberite artikal sa liste." _
, vbInformation, "AAA"
Response = acDataErrContinue
End If
cboProizvodID2_NotInList_Exit:
Exit Sub
cboProizvodID2_NotInList_Err:
MsgBox Err.Description, vbCritical, "Error"
Resume cboProizvodID2_NotInList_Exit
End Sub