Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

message after deleting the records in back-end table

Posted on 2011-03-22
10
Medium Priority
?
281 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

926 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