Solved

message after deleting the records in back-end table

Posted on 2011-03-22
10
232 Views
Last Modified: 2012-08-13
How could I avoid the below message that appear to the users when they open the form after I clear out the records from the back-end database table(transfer and delete the records).
"Run-time error 3021
No current record
End Debug Help"
Thank you
0
Comment
Question by:marian68
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 12

Expert Comment

by:rgn2121
Comment Utility
Not sure what you are doing without seeing code, or if this is something you need to resolve instead of just code around, but you might be able to use the code below just to hide the error if it is happening on form load.

On error goto Err_Form_Load




Exit_Form_Load:
exit sub

Err_Form_Load:
           if err.num <> 3201 then
                   'do something
           end if
         resume exit_Form_load

0
 
LVL 18

Expert Comment

by:lludden
Comment Utility
DOCMD.SETWarnings False

DOCMD.SetWarnings True
0
 
LVL 12

Expert Comment

by:rgn2121
Comment Utility
oops...3021 on that error....
0
 

Author Comment

by:marian68
Comment Utility
No one of the above code works.
Thank you
0
 
LVL 12

Expert Comment

by:rgn2121
Comment Utility
Where does the error take place...in the form load?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 12

Expert Comment

by:rgn2121
Comment Utility
Can you post the code from the routine that errors and tell us what line it errors on?
0
 
LVL 23

Accepted Solution

by:
OP_Zaharin earned 250 total points
Comment Utility
- this problem needs a hotfix from Microsoft. they release Access 2003 post-Service Pack 1 hotfix package for Microsoft Office Access 2003 that fixes the "Run-time error 3021" error:

http://support.microsoft.com/kb/887971
0
 
LVL 23

Expert Comment

by:OP_Zaharin
Comment Utility
- download and install the hotfix from the web given above. it should corrected the problem.
0
 

Author Comment

by:marian68
Comment Utility
Yes in the form load. It is the line "Me.OrderBy = "[DATE], [EXAMINER_S]" in the below code.
"Private Sub Form_Load()
Me.Filter = "[UserID]='" & fOSUserName() & "'"
Me.FilterOn = True
Me.OrderBy = "[DATE], [EXAMINER_S]"
    Me.OrderByOn = True

End Sub"
Thank you
0
 
LVL 12

Assisted Solution

by:rgn2121
rgn2121 earned 250 total points
Comment Utility
If there is nothing in the recordset that the table is bound to, then it isn't going to be able to order.
You tried the code below and it didn't work?

If so, then you can check if the recordset has any records...if not then skip the filter and order by...

if Me.RecordsetClone.recordCount > 0 then
'...........
end if
Private Sub Form_Load()
On error goto Err_Form_Load


Me.Filter = "[UserID]='" & fOSUserName() & "'"
Me.FilterOn = True
Me.OrderBy = "[DATE], [EXAMINER_S]"
    Me.OrderByOn = True

Exit_Form_Load:
exit sub

Err_Form_Load:
   if err.num <> 3201 then
        'do something
   end if
   resume exit_Form_load


End Sub

Open in new window

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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…

744 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

16 Experts available now in Live!

Get 1:1 Help Now