Export newly entered record to excel

Local time
Today, 10:05
Joined
Jul 29, 2005
Messages
62
Hi All,

I have a form from with a button that exports data in to excel using the following on click code
DoCmd.OutputTo acOutputQuery, "qrySoftPDR2", acFormatXLS, "FOBPDR.xls", True 'open in Excel
The problem is that if I go in to an existing record it works fine.
However if I have just input the record then it comes out blank. I'm guessing there is some sort of record update code I can use, but I've been unable to figure oput what it may be,

Thanks again
 
Hi guys just to let you know I finally managed to find a way round this, it was a combination of things I'd been trying individually.
The code I ended up using on the Click control was as follows:

Private Sub CmdFindCommandButton_Click()
If Me.Dirty Then
DoCmd.RunCommand acCmdSaveRecord
End If

DoCmd.OutputTo acOutputQuery, "qrySoftPDR", acFormatXLS, "FOBPDR.xls", True 'open in Excel

End Sub

Thanks again
 

Users who are viewing this thread

Back
Top Bottom