TransferSpreadsheet - If empty do not export

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using TransferSpreadsheet to run several queries to a single spreasheet
so that each query has it's own tab in the spreadsheet. Sometimes, some of
the queries are empty. Is it possible to specify that if the query is empty,
do not export?
 
Dim rst As Recordset

Set rst = Currentdb.OpenRecordset("MyQueryName")

If rst.Recordcount < 1 Then
MsgBox "No Records For This Query"
Else
DoCmd.TransferSpreadsheet......
End If
 
Back
Top