I am trying to autoate saving a comma delimited file using the TransferText Method.
This is my ultimate goal:
-Press the ExportConfirmation button
-A Inputbox appears asking for the file name
-I will enter ConfLtrDt and then the Month and Year
-And the file will save to:
G:\OE Book\Fulfillment\Confirmation\ **filename i entered in the input box**
I have the following code--but it's not working:
Private Sub ExportConfLtr_Click()
Dim FileName As String
FileName = Trim(InputBox("Enter a File Name", "File Name")
If FileName = "" Then
If vbYes = MsgBox("Do you want to Cancel?", vbYesNo + vbQuestion + vbDefaultButton2, "Cancel?" Then
FileName = "CANCEL"
End If
End If
DoCmd.TransferText acExportDelim, , "ConfirmationLetter", "G:\OE Book\Fulfillment\Confirmation\ConfLtr & Date & .doc"
End Sub
Where am I going wrong??
Beth
This is my ultimate goal:
-Press the ExportConfirmation button
-A Inputbox appears asking for the file name
-I will enter ConfLtrDt and then the Month and Year
-And the file will save to:
G:\OE Book\Fulfillment\Confirmation\ **filename i entered in the input box**
I have the following code--but it's not working:
Private Sub ExportConfLtr_Click()
Dim FileName As String
FileName = Trim(InputBox("Enter a File Name", "File Name")
If FileName = "" Then
If vbYes = MsgBox("Do you want to Cancel?", vbYesNo + vbQuestion + vbDefaultButton2, "Cancel?" Then
FileName = "CANCEL"
End If
End If
DoCmd.TransferText acExportDelim, , "ConfirmationLetter", "G:\OE Book\Fulfillment\Confirmation\ConfLtr & Date & .doc"
End Sub
Where am I going wrong??
Beth