Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ERROR 3021: No current record 1

Status
Not open for further replies.

sera

Technical User
Jun 29, 2000
360
US
I am receiving the error 3021. It says no current record and then it proceeds to preview the report anyway. I don't understand why I am getting this error and figured that someone must have come across this problem somewhere. Any help I can get will be greatly appreciated.
Thank You,
Sera
 
Are you running a report that is linked to the current record on the form calling the report? If so are you on a new record and access doesn't have any record to link to for your report?

Joe Miller
joe.miller@flotech.net
 
No that is not what I am doing. I am getting a report anyway. So somewhere Access knows the data exists and can retrieve it, it just pukes at me and then does what I want it to do.
Sera
 
What is the code behind your button that launches the report? Joe Miller
joe.miller@flotech.net
 
The code is just the standard wizard generated code, here it is.

Private Sub cmd_preview_partC_Click()
On Error GoTo Err_cmd_preview_partC_Click

Dim stDocName As String

stDocName = "Part C-Historic Sites"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_preview_partC_Click:
Exit Sub

Err_cmd_preview_partC_Click:
MsgBox Err.Description
Resume Exit_cmd_preview_partC_Click

End Sub
 
Well that is pretty generic MS code eh? :) Do you get the error when you run the report by itself? If yes, do you get the error when you run the query? If no, then the report is at fault, if yes then the query is at fault. If no to both, then something on your form is causing the issue. Don't really know how to help beyond going "back-to-basics" and finding out where the actual problem lies.

HTH Joe Miller
joe.miller@flotech.net
 
Well I can go back to basics myself. I was just thinking that someone might have run into this error before. Thank you for your help, I have now figured that the error must be in the report. Sometimes it is hard to simplify your steps in error trapping and you helped me with that.
Sera
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top