Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Automate to overwrite existing file using OutPutTo Macro


Message #1 by "Eun Namkung" <matvei27@y...> on Wed, 22 Aug 2001 21:49:22
Hello.  



I created a MACRO: OutPutTO to generate a SnapShot View File so that folks 

without Access 2000 can see Access reports.  



My plan is to set up this macro to a main form so that when an Access user 

closes the application each time, new snapshot view file will be generated 

(which reflects the real-time database).  





The problem comes here regarding maintiaining the database.  



Since an old snapshot view file exists in the folder of the network, the 

window asks you if you want to overwrite the existing file with a new 

file.  



It will be definately annoying if Access users are asked this question 

every time they use the database.



Is there any way to automatically overwrite existing file without asking 

the overwriting question?



The below is the converted Macro to VB Script.



Thanks.



Eun







Option Compare Database



'------------------------------------------------------------

' dvdlistWEbPage1

'

'------------------------------------------------------------



Function SnapshotFile()

On Error GoTo SnapshotFile_Err



    DoCmd.OutputTo acReport, "rptMainSnapShot", "SnapshotFormat

(*.snp)", "\\lonestar\production\dvdarchive\dvdlist.snp", False, ""





SnapshotFile_Exit:

    Exit Function



SnapshotFile_Err:

    MsgBox Error$

    Resume SnapshotFile_Exit



End Function
Message #2 by gail711@g... on Thu, 23 Aug 2001 10:49:23
Hi there

 Try Docmd.setwarnings false before the output line. 

 Hope it helps

Message #3 by "Derrick Flores" <Derrick_Flores@s...> on Thu, 23 Aug 2001 09:35:56 -0500
You can use the docmd.SetWarnings False at the begining of your macro and

docmd.SetWarning true after.



>>> "Eun Namkung" <matvei27@y...> 08/22 9:49 PM >>>

Hello. 



I created a MACRO: OutPutTO to generate a SnapShot View File so that folks

without Access 2000 can see Access reports.



My plan is to set up this macro to a main form so that when an Access user

closes the application each time, new snapshot view file will be generated

(which reflects the real-time database).





The problem comes here regarding maintiaining the database.



Since an old snapshot view file exists in the folder of the network, the

window asks you if you want to overwrite the existing file with a new file.



It will be definately annoying if Access users are asked this question

every time they use the database.



Is there any way to automatically overwrite existing file without asking

the overwriting question?



The below is the converted Macro to VB Script.



Thanks.



Eun







Option Compare Database



'------------------------------------------------------------

' dvdlistWEbPage1

'

'------------------------------------------------------------



Function SnapshotFile()

On Error GoTo SnapshotFile_Err



    DoCmd.OutputTo acReport, "rptMainSnapShot", "SnapshotFormat

(*.snp)", "\\lonestar\production\dvdarchive\dvdlist.snp", False, ""





SnapshotFile_Exit:

    Exit Function



SnapshotFile_Err:

    MsgBox Error$

    Resume SnapshotFile_Exit



End Function




  Return to Index