Hi..,
I am unable to Export Data Into Excel from table using query where "Export_Date"=Blank. in Table
Code:
If Me.Option5 = -1 Then
Set db = CurrentDb()
Set Q = db.QueryDefs("CBDataEntryDump_Branchwise")
Q.SQL = "Select * From CBDataEntryDump Where ([Branch_Name]= '" & TempVars!tempbranchname & "') AND ([Export]= '-1') AND Export_Date = NULL ;"
Q.Close
cbfilename = Environ("USERPROFILE") & "\Desktop\" & TempVars!tempbranchname & "_EquifaxReport_" & Format(Now(), "DDMMYYYY_HHMM") & ".xlsb"
DoCmd.OutputTo acOutputQuery, "CBDataEntryDump_Branchwise", acFormatXLSB, cbfilename, False
MsgBox " Data Exported to Desktop Sucessfully", vbInformation, "Data Export Successfully"
End If