Replace Line Breaks in Form control (1 Viewer)

jeran042

Registered User.
Local time
Today, 02:41
Joined
Jun 26, 2017
Messages
127
Good morning,

I am trying to replace line breaks (carriage returns) from within a form control. Here is what I am currently trying without luck:

Code:
=Nz(DLookUp(Replace(Replace("NOTES",Chr(13)," "),Chr(10)," "),"tblInvoiceLog","[VOUCHER_NUMBER]= " & [txtTEST] & ""),"")

The DLookUp result is correct, but the Replace functions do not remove the line breaks (or what I know are carriage returns)

Any suggestions?
Much appreciated,
 

MarkK

bit cruncher
Local time
Today, 02:41
Joined
Mar 17, 2004
Messages
8,178
Probably you mean to run the Replace() functions on the result of the DLookUp(). You are running the DLookUp() on the result of the the Replace() functions. See the difference?

Also, you can replace two characters at once, so you could do...
Code:
Replace(<dlookup result>, chr(13) & chr(10), " ")

hth
Mark
 

jeran042

Registered User.
Local time
Today, 02:41
Joined
Jun 26, 2017
Messages
127
Probably you mean to run the Replace() functions on the result of the DLookUp(). You are running the DLookUp() on the result of the the Replace() functions. See the difference?

Also, you can replace two characters at once, so you could do...
Code:
Replace(<dlookup result>, chr(13) & chr(10), " ")

hth
Mark

That is absolutely correct!

Careless oversight in the formula construction, thank you very much for your help!
 

Users who are viewing this thread

Top Bottom