473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Error 3265: Item not found in this collection

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
2 10274

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sivasenthil | last post by:
With the Runtime error above , I get the following message" Item cannot be found in the collection corresponding to the requested name or ordinal" Is this application specific or a common VB...
0
by: rajkalacbe | last post by:
I am running a visual basic executable program through Forms4.5 of D2K using Forms menu options.. When I Invoke this form in the server where I have the database installed, I do not have any...
6
by: darkhat01 | last post by:
I am getting a Run-Time error '3265': Item cannot be found in the collection corresponding to the requested name or ordinal. The Function call I am using is: ...
1
by: wassimdaccache | last post by:
Hello Please help me I working on database using access 2003 I'm writing into a save bottom on a form this code to insert some of my value on another table ...no relationship between them ...
2
by: marcohod | last post by:
Hi, I'm using ADO 2.8 in VB6 to use an SQL Server 2000 database. This works: Dim MyRS2 As New ADODB.Recordset MySQL = "Select * from table1" MyRS2.Open MySQL, sqlConnection,...
3
by: DGNinja12 | last post by:
I get this error when i run, i cant figure out what is wrong Can some one please help me? Run-time error '3265': Item cannot be found in the collection corresponding to the requested name or...
16
by: zandiT | last post by:
hello i'm using the microsoft audit trail example ACC2000: How to Create an Audit Trail of Record Changes in a Form and im having a problem with my recordset. in the example they are using a...
0
nurikoAnna
by: nurikoAnna | last post by:
Dim rsFaculty As New ADODB.Recordset Dim rsDepartment As New ADODB.Recordset Dim oCm As New ADODB.Command Private Sub Disconnect() connect.Close End Sub
8
by: charli | last post by:
Error 3265, "Item cannot be found in the collection corresponding to the requested name or ordinal" code programatically opens a query using ADOX and changed the sql Dim cat As New...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.