By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Error 3265: Item not found in this collection

P: n/a
I get this error message when I type in a new value. The code behind this
combo box is:

Private Sub City_NotInList(NewData As String, Response As Integer)
Response = Append2Table(Me![City], NewData)

End Sub

The top of the Error Dialog box is labeled Append2Table()
I am running a db saved as .mde in A2000

I know it worked at one time, but I am not sure when it stopped working. Can
anyone help?

Thanks,

Lee

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Lee Stafford via AccessMonster.com" <fo***@nospam.AccessMonster.com> schreef in bericht news:4F***********@AccessMonster.com...
I get this error message when I type in a new value. The code behind this
combo box is:



Private Sub City_NotInList(NewData As String, Response As Integer)
Response = Append2Table(Me![City], NewData)

End Sub

The top of the Error Dialog box is labeled Append2Table()
I am running a db saved as .mde in A2000

I know it worked at one time, but I am not sure when it stopped working. Can
anyone help?


The problem will be in the Append2Table() code I guess.
Can you post this specific code?

Arno R
Nov 13 '05 #2

P: n/a
Sometimes I am too impatient to wait for my message to post and in that time
I keep digging and find alternative solutions. This is what I ended up using
for that control. It works fine. I can still show the Append2 code if you
would like, but this works so I am fine now. :-)

Thanks, Lee

Private Sub City_NotInList(NewData As String, Response As Integer)

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strMsg As String
Dim City As AccessObject

strMsg = "'" & NewData & "' is not in our list. " & vbCrLf & vbCrLf
strMsg = strMsg & "Do you want to add " & NewData & " to the list? "
strMsg = strMsg & vbCrLf & vbCrLf & "Click Yes to add or No to re-type it.
"

If MsgBox(strMsg, vbQuestion + vbYesNo, "Add new name?") = vbNo Then
Set db = CurrentDb
Set rs = db.OpenRecordset("TBL_City", dbOpenDynaset)
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("TBL_City", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!City = NewData
rs.Update

If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded

End If
End If

rs.Close
Set rs = Nothing
Set db = Nothing
End Sub

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.