Solved

message after deleting the records in back-end table

Posted on 2011-03-22
10
260 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
ID: 35189431
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
ID: 35189435
DOCMD.SETWarnings False

DOCMD.SetWarnings True
0
 
LVL 12

Expert Comment

by:rgn2121
ID: 35189439
oops...3021 on that error....
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

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

Expert Comment

by:rgn2121
ID: 35189568
Where does the error take place...in the form load?
0
 
LVL 12

Expert Comment

by:rgn2121
ID: 35189576
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
ID: 35189611
- 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
ID: 35189628
- download and install the hotfix from the web given above. it should corrected the problem.
0
 

Author Comment

by:marian68
ID: 35189629
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
ID: 35189704
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

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…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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