in reply to Regular Expression help, MS Access Pipe delimited export gone bad
I stress again that you should really focus on correcting the problem from the source and then generating an usable export file. Important issues still hold true:
Once you create this module you can use the function to either write a sub that will process all text fields in the database, more simply create a Update Query that does the module call: Strip_crlf([fieldname]) for each "Update to:" text field. Then export the table as you originally wanted it.Option Compare Database Option Explicit Public Function Strip_crlf(mStr) Dim mNewStr As String mNewStr = mStr While (InStr(mNewStr, Chr(13))) Mid(mNewStr, InStr(mNewStr, Chr(13)), 1) = " " Wend While (InStr(mNewStr, Chr(10))) Mid(mNewStr, InStr(mNewStr, Chr(10)), 1) = " " Wend Strip_crlf = mNewStr End Function
HTH,
--Jim
|
|---|