Solved

how can I solve this ERROR

Posted on 2002-05-21
10
688 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
Comment Utility
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
Comment Utility
You could trace with F8 to see where error has ocurred?
0
 

Author Comment

by:toni2002
Comment Utility
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
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
Comment Utility
Try this:

Between these 2 lines refresh the data control...

   Fmain.Adodc1.Recordset.Update

 <<Fmain.Adodc1.Refresh >>

   Fmain.Adodc1.Recordset.Filter = ("ID > 0")
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
WHat fields are in the recordsets?

What is the value of PRD?

mlmcc
0
 

Author Comment

by:toni2002
Comment Utility
Hi,

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

thanks for help
0
 

Author Comment

by:toni2002
Comment Utility
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
Comment Utility
use

DoEvents

Between your updates and rs functions

-Ix
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now