Expand|Select|Wrap|Line Numbers
- Private Sub Export_Potential_Client_Data_Click()
- On Error GoTo Err_Export_Potential_Client_Data_Click
- Dim stDocName As String
- Dim strOriginalRecordSource As String
- Dim strNewRecordSource As String
- stDocName = "Export Potential Client"
- strOriginalRecordSource = Me.RecordSource
- strNewRecordSource = "SELECT * FROM [Potential Clients] WHERE [Number] = " & Me![Number]
- Me.RecordSource = strNewRecordSource
- DoCmd.OutputTo ObjectType:=acOutputReport, ObjectName:="Export Potential Client Report", OutputFormat:=acFormatTXT, Outputfile:="C:\Clients\Client Data.csv", AutoStart:=True
- Me.RecordSource = strOriginalRecordSource
I'm sure its something simple, but I can't seem to figure it out. Any ideas?
Thanks
Chip Stewart