Solved

how can I solve this ERROR

Posted on 2002-05-21
10
691 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

 
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 100

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 50 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Basic Excel Formatting error 4 127
Access query that references subform 5 47
Formula problem with Excel attachment 6 39
checkbox to hide entire section 10 42
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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 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