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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not in List - Doesn't Work Now?

Status
Not open for further replies.

akrshaw

Programmer
Oct 24, 2006
77
US

I have used the same On Not in List in 2 databases, no problems.

Start the 3rd one today, it is structured the same way...but I get the message:

The expression On Not in List you entered as the event property setting produced the following error: Object or class does not support the set of events.

**********************************************************
Private Sub Career_Title_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![Career Title].Undo
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rst = db.OpenRecordset("TblCareerTitle", dbOpenDynaset)
rst.AddNew
rst![Career Title] = NewData
rst.Update
Response = acDataErrAdded
End If

Set rst = Nothing
Set db = Nothing
End Sub
**********************************************************

The form goes directly back to the WorkerID table which has a Career Title field that is populated by TblCareerTitle.

It is just not clicking what I am doing or not doing?

Thanks so much!~

 
Check to make sure the project library references are set the same as the ones that work.

Cogito eggo sum – I think, therefore I am a waffle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top