The function Environ("UserProfile") will return the file location for each user
Try this:
Code:
Private Sub Command1_Click()
On Error Resume Next
Dim strText As String
'build the string for the output file on the user's desktop
strText = Environ("UserProfile") & "\Desktop\DistanceOutput.txt"
'Debug.Print strText
DoCmd.TransferText acExportDelim, "DistanceOutput", "q_Output_For_Distance_Program", strText, True, ""
But, as the final argument is blank it can be omitted. This is OK:
Code:
DoCmd.TransferText acExportDelim, "DistanceOutput", "q_Output_For_Distance_Program", strText, True
HTH
Colin