[AccessD] Load from test AGAIN

Martin Reid mwp.reid at qub.ac.uk
Wed Oct 18 14:33:36 CDT 2006


Heres the save sub.
 
Woudl someone mind giving this a go for me. 
 
Public Sub createtemplate()
    On Error GoTo Err_createtemplate
    Dim db As Database
    Dim doc As Document
    Dim conn As Container
    Dim strPath As String
    Set db = CurrentDb()
    strPath = "C:\forms\"
    
    'Export othe forms
    Set conn = db.Containers("Forms")
    For Each doc In conn.Documents
        Application.SaveAsText acForm, doc.Name, strPath & "Form_" & doc.Name & ".txt"
    Next doc
    
    'Export the Reports
    Set conn = db.Containers("Reports")
    For Each doc In conn.Documents
        Application.SaveAsText acReport, doc.Name, strPath & "Report_" & doc.Name & ".txt"
    Next doc
    
    Set conn = db.Containers("Modules")
    For Each doc In conn.Documents
        Application.SaveAsText acModule, doc.Name, strPath & "Module_" & doc.Name & ".txt"
    Next doc
    Set db = Nothing
    Set conn = Nothing
Exit_createtemplate:
    Exit Sub
Err_createtemplate:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_createtemplate
End Sub
 
 
Martin WP Reid
Training and Assessment Unit
Riddle Hall
Belfast
 
tel: 02890 974477
 

________________________________

From: accessd-bounces at databaseadvisors.com on behalf of Gustav Brock
Sent: Wed 18/10/2006 19:53
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Load from test AGAIN



Hi Martin

You need to remove spaces from the object name.

/gustav

>>> mwp.reid at qub.ac.uk 18-10-2006 20:46:56 >>>

The object name 'Customer Details.txt' does not follow Microsoft Access object naming rules


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com/> 




More information about the AccessD mailing list