D
DawnTreader
hello
what is wrong with this code:
Private Sub cmdExportToExcel_Click()
Dim savePathAndFileName As String
Me.txtCompleteFileName = Format(Me.txtFilterOrderedDateFromHidden,
"yyyy-mm-dd") & " to " & Format(Me.txtFilterOrderedDateToHidden,
"yyyy-mm-dd") & " " & Me.txtFileNameToExport
savePathAndFileName = "\\imwdb-01\servicedb\AftermarketReports\" &
Me.txtCompleteFileName & ".xls"
If IsNull(Me.txtFileNameToExport) Then
MsgBox "Please Enter a file name", vbOKOnly, "Enter File Name"
Else
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
qryPartSalesOrderQuerySystem, savePathAndFileName
End If
End Sub
it keeps telling me that i caused an error
runtime error 2498:
an expression you entered is the wrong datatype for one of the arguments
is there something i am doing wrong with the building of the path and file
name i want to save it in? or does it already know that i want a ".xls" on it?
what is wrong with this code:
Private Sub cmdExportToExcel_Click()
Dim savePathAndFileName As String
Me.txtCompleteFileName = Format(Me.txtFilterOrderedDateFromHidden,
"yyyy-mm-dd") & " to " & Format(Me.txtFilterOrderedDateToHidden,
"yyyy-mm-dd") & " " & Me.txtFileNameToExport
savePathAndFileName = "\\imwdb-01\servicedb\AftermarketReports\" &
Me.txtCompleteFileName & ".xls"
If IsNull(Me.txtFileNameToExport) Then
MsgBox "Please Enter a file name", vbOKOnly, "Enter File Name"
Else
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
qryPartSalesOrderQuerySystem, savePathAndFileName
End If
End Sub
it keeps telling me that i caused an error
runtime error 2498:
an expression you entered is the wrong datatype for one of the arguments
is there something i am doing wrong with the building of the path and file
name i want to save it in? or does it already know that i want a ".xls" on it?