?
Solved

how can I solve this ERROR

Posted on 2002-05-21
10
Medium Priority
?
695 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month13 days, 1 hour left to enroll

777 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