Screen messages

  • Thread starter Thread starter DD Bus 91
  • Start date Start date
DD Bus 91 said:
How to suppress messages when exporting reports to files ?

Tools/Options/Edit-Find uncheck "Confirm Action Queries" (Not really good
practice)

Better to place suppression around the export command in VBA

DoCmd.Setwarnings False
'do your export here
DoCmd.SetWarnings True

Regards,
Nick
 
Biz Enhancer a écrit :
Tools/Options/Edit-Find uncheck "Confirm Action Queries" (Not really good
practice)

Better to place suppression around the export command in VBA

DoCmd.Setwarnings False
'do your export here
DoCmd.SetWarnings True

Regards,
Nick

Thanks Nick, but it still opens a window each time it writes the file, may be I did not get it due to my poor english
Here is the function I wrote, including your suggestion :

Function export_compte(lot As Integer)
Dim FileName As String
Dim strLot As String

strLot = CStr(lot)
While Len(strLot) < 5
strLot = "0" & strLot
Wend


FileName = "C:\Parc\site\prive\president\lots\" & strLot & ".rtf"

DoCmd.SetWarnings False
DoCmd.OpenForm "Form_PropriétaireSel", , , , , acHidden
Forms!Form_PropriétaireSel!lot = lot
DoCmd.OpenReport "Etat_Compte_Saisies", acViewPreview, , , acHidden

DoCmd.OutputTo acOutputReport, "Etat_Compte_Saisies", acFormatRTF, FileName, False

DoCmd.Close acForm, "Form_PropriétaireSel"
DoCmd.Close acReport, "Etat_Compte_Saisies"
DoCmd.SetWarnings True

End Function
 
i'm not certain, but i think the access web http://www.mvps.org/access has
an answer
else try http://www.lebans.com

Pieter

Biz Enhancer a écrit :
Tools/Options/Edit-Find uncheck "Confirm Action Queries" (Not really good
practice)

Better to place suppression around the export command in VBA
DoCmd.Setwarnings False
'do your export here
DoCmd.SetWarnings True
Regards,
Nick

Thanks Nick, but it still opens a window each time it writes the file, may
be I did not get it due to my poor english
Here is the function I wrote, including your suggestion :

Function export_compte(lot As Integer)
Dim FileName As String
Dim strLot As String

strLot = CStr(lot)
While Len(strLot) < 5
strLot = "0" & strLot
Wend


FileName = "C:\Parc\site\prive\president\lots\" & strLot & ".rtf"

DoCmd.SetWarnings False
DoCmd.OpenForm "Form_PropriétaireSel", , , , , acHidden
Forms!Form_PropriétaireSel!lot = lot
DoCmd.OpenReport "Etat_Compte_Saisies", acViewPreview, , , acHidden

DoCmd.OutputTo acOutputReport, "Etat_Compte_Saisies", acFormatRTF,
FileName, False

DoCmd.Close acForm, "Form_PropriétaireSel"
DoCmd.Close acReport, "Etat_Compte_Saisies"
DoCmd.SetWarnings True

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top