?
Solved

how can I solve this ERROR

Posted on 2002-05-21
10
Medium Priority
?
699 Views
Last Modified: 2008-03-10
Hi,

if I run the following code i receive the error shown below :
Fmain.Adodc1.RecordSource = Levl
Fmain.Adodc1.Refresh
Fmain.Adodc2.RecordSource = Tr
Fmain.Adodc2.Refresh

Fmain.Adodc1.Recordset.Filter = ("ID = " & WDay)
Fmain.Adodc2.Recordset.Filter = ("ID = " & WDay)
     
If IsNull(Fmain.Adodc1.Recordset("Field" & PRD)) = True Then
     Fmain.Adodc1.Recordset("Field" & PRD) = SB
     Fmain.Adodc1.Recordset.Update
     Fmain.Adodc1.Recordset.Filter = ("ID > 0")
End If
     
 
Run Time Error  “2147217864 (80040e38)”

"The Specified Row Could Not Be Located For Updating ; Some Values May Have Been Changed Since It Was Last Read."

how can i solve this error? if i use 'on Error Resume next' i feel afraid it doesnt solve it but pass over it without updating the record.

Note: I use Access 97 table and ADO. wday & PRD are variables

Many Thanks
Toni2002
0
Comment
Question by:toni2002
10 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7025465
is your recordsource updatable?
Also, try not to use ado data control and manage db with active x data objects.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7025466
You could trace with F8 to see where error has ocurred?
0
 

Author Comment

by:toni2002
ID: 7025490
Sir,
thanx for replying. my recordset is updated. i want to note that if i use F8 i don't receive this this error but in using F5 i receive it
the error occurs in this line :
Fmain.Adodc1.Recordset.Update

toni2002
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7025554
then, it appears like a timeout problem.
Try commenting the line that causes error since you are refreshing the filter, datacontrol should update the record for you and let me know.
It is not the best approach, just a try.
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 7025592
Try this:

Between these 2 lines refresh the data control...

   Fmain.Adodc1.Recordset.Update

 <<Fmain.Adodc1.Refresh >>

   Fmain.Adodc1.Recordset.Filter = ("ID > 0")
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 7025632
WHat fields are in the recordsets?

What is the value of PRD?

mlmcc
0
 

Author Comment

by:toni2002
ID: 7026220
Hi,

PRD is integer . the field names which i want to be updated are Field1, Field2 , .....

thanks for help
0
 

Author Comment

by:toni2002
ID: 7026227
Hi experts,

now I am not in my office , then i'll try your suggestions may after 12 hours

Regards
thanks and i look forward your continuous help.

toni2002
0
 
LVL 2

Expert Comment

by:Ixeus
ID: 7026525
use

DoEvents

Between your updates and rs functions

-Ix
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 7026655
Do you have a primary key? If not then this is not surprising as in order to update only the specified row you need to have a unique key which identifies it. You may have more than one row with the same values and the implicit update statement may cause more than one row to be updated. Ensure that you have a primary key for the table and this problem will go away.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question