I would like to take the USERNAME of the person logged in and pass it to the address of the transferspreadsheet function, below is an example:
however the above code doesn't work, any ideas??
Thanks
Brian
Code:
Private Sub Command3_Click()
Dim User As String
User = Environ$("USERNAME")
On Error GoTo SendError
'Tricare Reports
DoCmd.TransferSpreadsheet acExport, , "90JJ AR Sum By Rej", "C:\Documents and Settings\[B][SIZE=3]user[/SIZE][/B]\Desktop\DeepDiveReports\Grp 11 DeepDive Reports.xls", True
however the above code doesn't work, any ideas??
Thanks
Brian