T
TC
Untested:
dim sAddress as string, n as integer
sAddress = trim$ (nz (me![txtAddress], ""))
n = instr (sAddress, vbcr)
if n > 0 then
sAddress = rtrim$ (left$ (sAddress, n - 1)) & " " & _
ltrim$ (mid$ (sAddress, n + len (vbcr)))
endif
msgbox sAddress
The line break is probably a return/linefeed combination: not just a return.
If so, replace vbcr with vbcrlf in two places above.
If the address could contain >several< lines (seperated by rerturn
[linefeed]):
n = instr (...)
while n > 0
sAddress = ...
n = instr (...)
wend
where ... means "as before".
HTH,
TC
dim sAddress as string, n as integer
sAddress = trim$ (nz (me![txtAddress], ""))
n = instr (sAddress, vbcr)
if n > 0 then
sAddress = rtrim$ (left$ (sAddress, n - 1)) & " " & _
ltrim$ (mid$ (sAddress, n + len (vbcr)))
endif
msgbox sAddress
The line break is probably a return/linefeed combination: not just a return.
If so, replace vbcr with vbcrlf in two places above.
If the address could contain >several< lines (seperated by rerturn
[linefeed]):
n = instr (...)
while n > 0
sAddress = ...
n = instr (...)
wend
where ... means "as before".
HTH,
TC