Hi,
Why this error occurs?
Regards.
Seema_s
Printable View
Hi,
Why this error occurs?
Regards.
Seema_s
What's the context of the error. In and of itself, it's fairly self explanatory... However you're trying to access the row, it is not available.
What type of Database are you using (MS Access?). When are you getting this error? What code are you running?
:)
Hi,Quote:
Originally Posted by mateo107
I am using MS Access. When I am trying to close it by clicking the top right button "X" it throws that error: "The current row is not available". I hope there some problem with using the following code. Could you please help me out?
VB Code:
Private Sub Form_Unload(Cancel As Integer) Dim oForm As Form If rs.State = adStateOpen Then rs.Close End If If db.State = adStateOpen Then db.Close End If For Each oForm In Forms Unload oForm Next End Sub
Seema_S
First of all you debug your form unload event. This error occurs when we are trying to access a recordset and it is closed. Most probably you will find error location during debuggin try it.
Thanks, Mr. Zubair! How to debug it? Can you explain a bit clear, please?Quote:
Originally Posted by zubairkhan
Seema_S
in your vb editor click left side to your code line where u want to start debuggin when u click on left side of code a marron dot will appear, it is your debbuging point. Start your program when program reaches to your debugging pint it display code the press F8 for each step.
I tried. Just it is going through the lines highlighting in yellow color. How do I know that where the error occured?Quote:
Originally Posted by zubairkhan
Seema_s
go on by pressing "F8" Key untill u get error..then u r able 2 know what is the line that causing 4 the error..
Press F8 untile u get error message
Hi, I didnot fin any error during debugging. But when I try to close application using close button ("X") top right corner of the form the error occurs:Quote:
Originally Posted by nagasrikanth
The current row is not available. But when I close it clicking on close button which I put on the form, there is no error.
Regards.
Seema_s
strange....r u sure the error is related to this form only...
Y i had this doubt means...I found in ur form_unload event ,u r trying to close all the forms....which might cause the problem...
if u dont have any problem y can't u attach u r project... ???HTML Code:For Each oForm In Forms
Unload oForm
Next
why dont u just use
set rs = nothing where rs is your recordset instead of checking those if conditions...
hi litlewiki
ofcourse we can use that...but is the problem if I use the if statement...any how there wasn't any error when checked in Debug mode...
why dont u try it out in the form query unload event ??
I am completely messed in this problem. How to solve it or what is the best way to avoid such errors in future.Quote:
Originally Posted by litlewiki
Seema_S
Cooooll....
Try to post the exact problem or project....dont be confuse....
Seema, you should check arround your forms wheither your wrote commands in forms Terminate or Deactivate Event. It may be possible this error returns from any other form.
It is ok. I will try to find out.Quote:
Originally Posted by zubairkhan
seema_s