R
redtux
I have the following code which works without anty problem
Dim dir_save As String
Dim date1 As String
date1 = format(Now(), "yyyymmddhm")
dir_save = "h:\"
DoCmd.TransferText acExportDelim, , "dump_all", dir_save & "feedback" &
date1 & ".csv", True
DoCmd.TransferText acExportDelim, , "tb_progress", dir_save &
"progress.csv", True
DoCmd.TransferText acExportDelim, , "tb_client", dir_save & "client.csv", True
DoCmd.TransferText acExportDelim, , "lk_org", dir_save & "lk_org.csv", True
DoCmd.TransferText acExportDelim, , "lk_stages", dir_save & "lk_stages.csv",
True
However
If I run this
Dim Report As String
Dim format As Variant
Dim filename As String
Dim dir As String
Dim date4 As String
Dim subdir As String
Dim dir_save As String
'Dim officer As String
'Stage = DLookup("[stage]", "lk_stages", "[stage]= Stage_reached")
Dim fs
date4 = format("11/13/2006", "yyyymmdd")
Set fs = CreateObject("scripting.filesystemobject")
dir = CurrentDBDir()
subdir = dir & "outstanding" & officer
If Not fs.folderexists(subdir) Then MkDir subdir
dir_save = subdir & "\" & date4 & "\"
'dir_save = subdir & "\"
Report = "rp_outstanding_by_officer"
format = "SNP"
filename = dir_save & "\" & officer & "." & format
DoCmd.OutputTo acOutputReport, Report, acFormatSNP, filename, False
I get data type mismatch on the date format line
Can anyone explain why the same code works in one module and not another
(Same Database access XP)
Dim dir_save As String
Dim date1 As String
date1 = format(Now(), "yyyymmddhm")
dir_save = "h:\"
DoCmd.TransferText acExportDelim, , "dump_all", dir_save & "feedback" &
date1 & ".csv", True
DoCmd.TransferText acExportDelim, , "tb_progress", dir_save &
"progress.csv", True
DoCmd.TransferText acExportDelim, , "tb_client", dir_save & "client.csv", True
DoCmd.TransferText acExportDelim, , "lk_org", dir_save & "lk_org.csv", True
DoCmd.TransferText acExportDelim, , "lk_stages", dir_save & "lk_stages.csv",
True
However
If I run this
Dim Report As String
Dim format As Variant
Dim filename As String
Dim dir As String
Dim date4 As String
Dim subdir As String
Dim dir_save As String
'Dim officer As String
'Stage = DLookup("[stage]", "lk_stages", "[stage]= Stage_reached")
Dim fs
date4 = format("11/13/2006", "yyyymmdd")
Set fs = CreateObject("scripting.filesystemobject")
dir = CurrentDBDir()
subdir = dir & "outstanding" & officer
If Not fs.folderexists(subdir) Then MkDir subdir
dir_save = subdir & "\" & date4 & "\"
'dir_save = subdir & "\"
Report = "rp_outstanding_by_officer"
format = "SNP"
filename = dir_save & "\" & officer & "." & format
DoCmd.OutputTo acOutputReport, Report, acFormatSNP, filename, False
I get data type mismatch on the date format line
Can anyone explain why the same code works in one module and not another
(Same Database access XP)