Question

Q: ACCESS: 3021 Error - No Current Record Found This thread is locked from future replies

Hi, 

Does anyone know how I can stop the above error happening?

Thanks.

Answer

A:

between these lines in the function:

    xlWSh.Range("A1").Select

    For Each fld In rst.Fields

 

put

 

If rst.RecordCount = 0 Then

    Msgbox "There are no records to export"

    Exit Function

End If


Bob Larson, Former Access MVP (2008-2010) http://www.btabdevelopment.com (free Access tools, tutorials, and samples)
-----
Microsoft Access MVP 2008, 2009, 2011
If a post was helpful click the FOUND THIS HELPFUL link

Did this solve your problem?

Sorry this didn't help.

24 people were helped by this reply



 
Question Info

Views: 32,593 Last updated: April 17, 2018 Applies to: