473,545 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
+ 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 anycommentsssss ss plzzzzzzzzzzzzz zzzzz
Oct 11 '07 #1
1 3894
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
3964
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 information. I need to calculate the bi-weekly gross pay (BWG) for each employee. The BWG is slightly different for leap years. As the BWG will...
2
10282
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!, NewData) End Sub
9
8006
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 search Set objFindResults = objApp.ActiveMap.FindAddressResults("One Microsoft Way", "Redmond", , "WA", , geoCountryUnitedStates) MsgBox "The first...
18
4714
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 class where only the "searched" property has a value. I expected to get the index into the arraylist where I could then get the entire class...
4
6470
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 based on a table. Here is my code (setting the QueryDef is causing the error, see text in bold/italics): Dim MyExcel As Excel.Application ...
1
1836
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 .Refresh With .Recordset
2
5991
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, adOpenKeyset, adLockOptimistic If MyRS2.Supports(adAddNew) Then 'With MyRS2 ' .AddNew
16
3537
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 bound form so the text box called tbAuditTrail has a control source of the AuditTrail field in the table. My form is unbound. i tried to conncet my...
8
6284
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 ADOX.Catalog Dim cmd As New ADODB.Command cat.ActiveConnection = CurrentProject.Connection Set cmd = cat.Procedures("qryLostCostCodes").Command 'opens...
0
7406
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7813
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7431
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5976
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4949
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3457
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1888
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 we have to send another system
0
709
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.