Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-12-2019, 09:30 AM   #1
bignose2
Newly Registered User
 
Join Date: May 2010
Posts: 156
Thanks: 0
Thanked 2 Times in 2 Posts
bignose2 is on a distinguished road
RichText Memo adds a space to beginning of line

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>&nbsp;</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 by bignose2; 01-13-2019 at 12:13 AM.
bignose2 is offline   Reply With Quote
Old 01-16-2019, 11:49 AM   #2
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,683
Thanks: 393
Thanked 814 Times in 777 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: RichText Memo adds a space to beginning of line

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!
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 01-16-2019, 12:15 PM   #3
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 8,304
Thanks: 99
Thanked 2,124 Times in 1,973 Posts
isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light
Re: RichText Memo adds a space to beginning of line

Just replace all non breaking spaces with an empty string using a update query
Code:
Replace([FieldName],"nbsp;","")

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 01-17-2019, 02:09 AM   #4
bignose2
Newly Registered User
 
Join Date: May 2010
Posts: 156
Thanks: 0
Thanked 2 Times in 2 Posts
bignose2 is on a distinguished road
Re: RichText Memo adds a space to beginning of line

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.
bignose2 is offline   Reply With Quote
Old 01-17-2019, 02:12 AM   #5
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 8,304
Thanks: 99
Thanked 2,124 Times in 1,973 Posts
isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light
Re: RichText Memo adds a space to beginning of line

Hi
If you read my previous answer again, you will notice the semicolon at the end of the expression "&nbsp;"
I tested my expression before posting.
If you copy it exactly it will work
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 01-17-2019, 02:31 AM   #6
bignose2
Newly Registered User
 
Join Date: May 2010
Posts: 156
Thanks: 0
Thanked 2 Times in 2 Posts
bignose2 is on a distinguished road
Re: RichText Memo adds a space to beginning of line

Hi,

Thanks again

mine was a Typo & I did have it correct & it does remove the "&nbsp;" 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.
bignose2 is offline   Reply With Quote
Old 01-17-2019, 03:21 AM   #7
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 8,304
Thanks: 99
Thanked 2,124 Times in 1,973 Posts
isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light
Re: RichText Memo adds a space to beginning of line

Quote:
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>","")

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 01-18-2019, 02:52 AM   #8
bignose2
Newly Registered User
 
Join Date: May 2010
Posts: 156
Thanks: 0
Thanked 2 Times in 2 Posts
bignose2 is on a distinguished road
Re: RichText Memo adds a space to beginning of line

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.
bignose2 is offline   Reply With Quote
Old 01-18-2019, 03:21 AM   #9
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 8,304
Thanks: 99
Thanked 2,124 Times in 1,973 Posts
isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light isladogs is a glorious beacon of light
Re: RichText Memo adds a space to beginning of line

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?

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RTF Memo field has space at start of blank line bignose2 Forms 1 01-20-2017 04:00 AM
Remove blank space at the beginning of a cell bn1974 Modules & VBA 7 05-05-2016 06:51 AM
Export from Access to rft format adds line break ToreTraja Reports 2 03-10-2014 11:53 AM
Delete <space> if at beginning or end of value? eepok General 6 12-04-2007 02:19 PM
Memo field - export to Word adds line breaks keryn Reports 0 07-18-2004 05:19 PM




All times are GMT -8. The time now is 11:28 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World