RichText Memo adds a space to beginning of line

bignose2

Registered User.
Local time
Today, 13:09
Joined
May 2, 2010
Messages
248
Hi,
Office 365. Always had this issue but ignored but would like to find out why

RTF Memo field

If I type as below with just enter, no press of space or arrow
1
2

3

4

5

However, once record is updated by simply clicking on record selector, Moving to top and cursor down there is always a space at beginning of blank line, so as below I arrow JUST down and press x it is already at the end of a 1 space line.

1
2
.x
3
.x
4
.x
5
.x
6
.x

(Does not show up in this post so I have put a . where the blank space really is)

Bit annoying as you always have to back space to start typing/add anything.

Not sure if same issue as I am trying to record where the cursor is using seltext, works OK but as soon as any Lines/Enter & updated, it is always a number of characters out. I know with all the hidden <br> etc may be a issue.

update: Just noticed I asked the same back in 2010 so put up with it for a long time!
Which reminded me it is adding <div> </div> when I press enter, so a new line with a space?
As then not sure if I can strip just this out with replace (could not get code to work in 2010) but also whether I wanted it to because perhaps might really want this in some situations.
Would rather it just did not do it in the first place by simply pressing Enter

Thanks I/A
 
Last edited:
My main motivation for posting is to bump your post up the list because it has yet to receive a reply. However I have had similar problem with SQL Statements where copying them around in Access can occasionally allow a line feed character creep in. What I do is copy the offending text into an online interface to show hidden characters like this one:- https://www.soscisurvey.de/tools/view-chars.php

I can't think of anything else except to hope that someone else might have some idea and provide you with an answer!
 
Just replace all non breaking spaces with an empty string using a update query
Code:
Replace([FieldName],"nbsp;","")
 
Hi,

Thanks for the reply,

I think it is just the annomoly of how different browsers etc & access (limited) interpret html tags & know can be different all over.

Replacing &nbsp unfortunately does not help
<div></div> still has a space between, if no text at all.

I am testing simply replacing <div>&nbsp</div> with <br>
does seem to work & from what i read should be no side effects

Would have preferred to understand but think it is just the way it is.
 
Hi
If you read my previous answer again, you will notice the semicolon at the end of the expression " "
I tested my expression before posting.
If you copy it exactly it will work
 
Hi,

Thanks again

mine was a Typo & I did have it correct & it does remove the " " OK

however left with <div></div> which in a rich text, memo (LongText) field STILL gives a space

<div>X<div> simply gives X & no extra space.

Any <br> seems to work, its not the end of the work but bit of a pain.

Not sure if it is this annomoly or something else but it also effect SelText & position of where the cursor was, I try to set current position, move off the control & back again but as soon as left the control it updates and the position is NOT the same as when you go back it is 4 or 5 out & just figured is must be something to do with this.
 
however left with <div></div> which in a rich text, memo (LongText) field STILL gives a space

Not true. It leaves a blank line which is a different matter
To fix that issue, just do this
Code:
Replace([FieldName],"<div></div>","")
 
Hi,

That is interesting that you do not get a space,

<div></div> definitely give me a space (as well as the line)

I have latest Office 365, a hundred times check the table source is correct & any controls are Rich Text.

I do want a blank line hence by replacement with <br> as if I use Replace([FieldName],"<div></div>","")

I don't get any spacing,

thanks anyway, it works enough now.
 
Confused.
How would you know if an empty line comprising the code <div></div> contains a space?
Surely you could only tell by adding a character between the tags ... But then it's not a empty line. Am I being dense?
 

Users who are viewing this thread

Back
Top Bottom