Hi,
I want to call a subroutine in my VB6 app when an event occurs and append some data to a txt file. I have the following code which I want to open a .txt file that resides in a folder (with full permisisons) based on this week's number and the year.
Problem is, I get an error when my event triggers. I'm thinking my syntax is wrong somewhere but my VB knowledge is very limited. Can you give me some guidance? thanks.
I want to call a subroutine in my VB6 app when an event occurs and append some data to a txt file. I have the following code which I want to open a .txt file that resides in a folder (with full permisisons) based on this week's number and the year.
Code:
Public Sub BadgeLog()
Dim d As Date
Dim Week As Integer
Dim YearNow As Integer
Dim Path As String
d = dateTime.Now
Week = DatePart("ww", Now())
YearNow = Year(Now)
Path = "\\server\folder\sub_folder\sub_folder\sub_folder\sub_folder\" + YearNow \ " + Week\tracking.txt"
Open "Path" For Append As #1
Print #1, d, MFGLINE$
Close #1
End Sub