473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Item not found in this collection. (Error 3265)

222 New Member
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

Expand|Select|Wrap|Line Numbers
  1.  
  2. If (CustomerID <> "") Then
  3. Dim stcriteria As String
  4. stcriteria = "[customerid]= " & [CustomerID]
  5. Dim myrs As Recordset
  6. Dim mydb As Database
  7. Dim mysql1 As String
  8. Set mydb = CurrentDb()
  9. x = DSum("[total]", "[invoicepayment]", stcriteria)
  10. Me.spayments = x
  11.  mysql1 = "select * from [invoicepayment]"
  12. Set myrs = mydb.OpenRecordset(mysql1, dbOpenDynaset)
  13. myrs.AddNew
  14. myrs![custid] = Me.CustomerID
  15. myrs![PaymentID] = Me.PaymentID
  16. myrs![PaymentAmount] = Me.PaymentAmount
  17. myrs![date] = Me.date
  18. myrs![Account] = Me.screditinvoices - Me.spayments
  19. myrs.Update
  20. End If
  21.  
  22.  
I'm getting this error Item not found in this collection. (Error 3265) on

myrs![custid]=me.customerid
and i'm sure that the there is a field on table named custid I checked maybe more than 100 times anycommentsssssss plzzzzzzzzzzzzzzzzzz
Oct 11 '07 #1
1 3887
Rabbit
12,516 Recognized Expert Moderator MVP
Here your field is named customerid.
Expand|Select|Wrap|Line Numbers
  1. stcriteria = "[customerid]= " & [CustomerID]
  2. x = DSum("[total]", "[invoicepayment]", stcriteria)
  3.  
But here, your field is named custid even though it's the same recordset.
Expand|Select|Wrap|Line Numbers
  1.  mysql1 = "select * from [invoicepayment]"
  2. Set myrs = mydb.OpenRecordset(mysql1, dbOpenDynaset)
  3. myrs![custid] = Me.CustomerID
  4.  
One of them is wrong. I'm guessing custid should be customerid.
Oct 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: RBohannon | last post by:
I had some help on this one earlier, but I'm still having a bit of trouble. I'm sure it's something simple that I just don't know. I'm using Access2000. I have one table with employee salary...
2
by: Lee Stafford via AccessMonster.com | last post by:
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!,...
9
by: Gerald Lightsey | last post by:
I am doing some work that involves automating MS MapPoint 2002. The object model is documented in the context of Visual Basic 6.0. A typical example follows. 'Output first result of find...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
4
by: egewitz | last post by:
I keep getting this error and it's driving me crazy: 3265 - Item Not Found In This Collection I'm using MS Access 2003. Through VBA I'm attempting to fill in an excel spreadsheet with a query...
1
by: krisinfo | last post by:
When i run my program it will show this error,this is run time error... My code is Dim vLst As ListItem lstExisting.ListItems.Clear With dtaDB .RecordSource = vSQL ...
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,...
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...
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: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.