I have a database that worked fine in Access 2003. Now that I'm using Access 2007, it gives a run-time 3027 error. It is breaking down on the DoCmd.TransferText line. I've tried this on multiple computers (XP, Win7) and the file is being saved to the C: drive and I have administrative privileges. The MBNAExportSpecification export spec does exist in the MSysIMEXSpecs table. I also did the old jet registry hack to add the .prn extension to the list of exports (worked fine in 2003). Here is the code:
Code:
Private Sub Export_Click()
Dim TempFileName As String
Me.Form![txtFileName].SetFocus
TempFileName = txtFileName.Text
DoCmd.TransferText acExportFixed, "MBNAExportSpecification", "ExportTable", TempFileName
Me.Form![txtFileName].SetFocus
MsgBox ("Successfully exported the file " & txtFileName.Text)
Me.Form![txtFileName].SetFocus
End Sub
Private Sub Form_Load()
Dim DateToFilename As String
DateToFilename = "C:\" & Format(Date, "mmddyyyy")
Me.Form![txtFileName].SetFocus
txtFileName.Text = DateToFilename & ".prn"
End Sub