E
Eric
what is the best way to do this using VBA inside access 2007? The sharepoint
record "tickets" is linked. I've tried the loadtofile function with the
following code and get "invalid argument" at that line.
'Save files to sharepoint
Set rst = db.OpenRecordset("Tickets")
Do Until rst.EOF
If rst!TicketNr = newWO Then
Set rst1 = rst.Fields("Attachments").Value
Y = 1
Do Until Y = z - 1
strFile = "C:\" & Files(Y)
rst.Edit
rst1.AddNew
rst1.Fields("FileData").LoadFromFile strFile
rst1.Update
rst.Update
Y = Y + 1
Loop
rst1.Close
End If
rst.MoveNext
Loop
rst.Close
record "tickets" is linked. I've tried the loadtofile function with the
following code and get "invalid argument" at that line.
'Save files to sharepoint
Set rst = db.OpenRecordset("Tickets")
Do Until rst.EOF
If rst!TicketNr = newWO Then
Set rst1 = rst.Fields("Attachments").Value
Y = 1
Do Until Y = z - 1
strFile = "C:\" & Files(Y)
rst.Edit
rst1.AddNew
rst1.Fields("FileData").LoadFromFile strFile
rst1.Update
rst.Update
Y = Y + 1
Loop
rst1.Close
End If
rst.MoveNext
Loop
rst.Close