Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automation error (Error 440) SubForm Not in List Event

Status
Not open for further replies.

Elvis72

Technical User
Dec 6, 2007
211
US
I have a Not in List Event on another subform in my database works great.

So, applied same criteria to a new subform.

Now when I go to create the Not in List Event I get this error:

Automation error
Unspecified error

Now I have other Not in List Events scattered throughout my forms, but when I get this error and the blank code window closes it brings up the previous subforms code window and it is all highlighted?

It's almost like its telling me you already have one of those you can't have 2 in the same database?

I would try different code for the Not in List Event but I can't even get that far?

The Original Code for the working subform is:

Private Sub ExperienceID_NotInList(NewData As String, Response As Integer)
Dim db As DAO.Database, rst As DAO.Recordset
Dim Msg As String, Style As Integer, Title As String, DL As String

DL = vbNewLine & vbNewLine
Msg = "'" & NewData & "' is not an available item " & DL & _
"Do you want to add this item to the current list? " & DL & _
"Click Yes To Add " & NewData & " to the list" & DL & _
"Click No to re-type it."
Style = vbQuestion + vbYesNo
Title = "Add New Item?"

If MsgBox(Msg, Style, Title) = vbNo Then
Me!Experience.Undo
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rst = db.OpenRecordset("tblExperience", dbOpenDynaset)
rst.AddNew
rst!Experience = NewData
rst.Update
Response = acDataErrAdded
End If

Set rst = Nothing
Set db = Nothing
End Sub

The new subform isn't on the same mainform nor does it share any criteria besides the jobproposalno field?

 
hOW ARE YA Elvis72 . . .

Perform a Compile!

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top