Share via

error 3021 No current Record

Anonymous
2023-08-16T08:28:27+00:00

Hi

if my db rund out of data then i get the standard ,error 3021 No current Record, end and debug.

i want instead a message box where i can make sure the user knows theres no data but have a button to take into another form.

is there a way to do that please

thanksyou

Microsoft 365 and Office | Access | For education | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

ScottGem 68,830 Reputation points Volunteer Moderator
2023-08-16T09:53:59+00:00

Yes, its called Error Trapping. I suggest searching on Access VB Error Trapping to find more details. You didn't give us enough info to give more than a suggestion.

It might look like this

ON ERROR GOTO ErrorHandler 'This line goes near the top of your code

:ErrorHandler

Select Case Err.Number

 Case 3021

       MsgBox "your message"

 Case Else

      MsgBox Err.Number & "-" & Err.Description

End Case

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful