J
Jim Ory
Using WinXP and Access2K2
In the following 'on click' event in visual basic a text file is produced
and sent to a file folder. The file name is always the same. I'd like to be
able to append the current date to the file name ending up with as an
example; "ADIF_11032007.adi", or whatever date it happens to be at the time
of the report. My code so far:
Dim stDocName As String
Dim MyDate As String
MyDate = Date
'Selects which report to use based on queries for each report
If optQSL = 1 Then
stDocName = "rptADIF_eQSL"
ElseIf optQSL = 2 Then
stDocName = "rptADIF_LoTW"
End If
DoCmd.OutputTo acOutputReport, stDocName,_ acFormatTXT,
"C:\Ham\ADIF_Files\ADIF.adi"
Exit_Adif_Click:
Exit Sub
Err_Adif_Click:
MsgBox Err.Description
Resume Exit_Adif_Click
End Sub
------------------------------------------------------------------------------------------------
In visual basic help:
Date Function Example
This example uses the Date function to return the current system date.
Dim MyDate
MyDate = Date ' MyDate contains the current system date.
In the following 'on click' event in visual basic a text file is produced
and sent to a file folder. The file name is always the same. I'd like to be
able to append the current date to the file name ending up with as an
example; "ADIF_11032007.adi", or whatever date it happens to be at the time
of the report. My code so far:
Dim stDocName As String
Dim MyDate As String
MyDate = Date
'Selects which report to use based on queries for each report
If optQSL = 1 Then
stDocName = "rptADIF_eQSL"
ElseIf optQSL = 2 Then
stDocName = "rptADIF_LoTW"
End If
DoCmd.OutputTo acOutputReport, stDocName,_ acFormatTXT,
"C:\Ham\ADIF_Files\ADIF.adi"
Exit_Adif_Click:
Exit Sub
Err_Adif_Click:
MsgBox Err.Description
Resume Exit_Adif_Click
End Sub
------------------------------------------------------------------------------------------------
In visual basic help:
Date Function Example
This example uses the Date function to return the current system date.
Dim MyDate
MyDate = Date ' MyDate contains the current system date.