Msgbox popup vs Text Box Display (1 Viewer)

pardue

New member
Local time
Today, 13:16
Joined
Jul 26, 2022
Messages
3
I am importing data from a spreadsheet and the formatting works fine in msgbox but when I link the field to a textbox the formatting is lost.

Please advise on method to resolve this issue...

Here is msgbox output

1658828217607.png


Text Box
1658828285798.png

Please advise on how to set the formatting in the textbox to emulate the msgbox.

Thank you...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:16
Joined
May 7, 2009
Messages
19,231
you can try to Set the Text Format of the textbox to Rich Text instead of Plain Text.
 

pardue

New member
Local time
Today, 13:16
Joined
Jul 26, 2022
Messages
3
thank you for the reply. I tried that and it did not change the formatting.
 

Minty

AWF VIP
Local time
Today, 07:16
Joined
Jul 26, 2013
Messages
10,366
You may find that the line feeds in the spreadsheet are exactly that just a line feed.
Access expects LFCR as it's line break. Try using
Code:
MyFormattedField: Replace ([YourField],Chr(10),Chr(10) & Chr(13))

In a query to see if it gives you the correct results
 

pardue

New member
Local time
Today, 13:16
Joined
Jul 26, 2022
Messages
3
I inserted this code...
lresult = Replace(frmDetails!StatusDetails, Chr(10), Chr(10) & Chr(13))
MsgBox (lresult)
frmDetails!TextDetail = lresult

msgbox result
1658832825119.png


text box output
1658832892512.png
 

Minty

AWF VIP
Local time
Today, 07:16
Joined
Jul 26, 2013
Messages
10,366
Any chance you can post up an example spreadsheet with some of the original formatted text.
That way we can examine it to see what the formatting consists of.

You may need to zip the file as you have a low(<10) post count on the forum.

EDIT: it should have been

MyFormattedField: Replace ([YourField],Chr(10),Chr(13) & Chr(10))
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:16
Joined
May 7, 2009
Messages
19,231
see this demo.
 

Attachments

  • TextMsg.accdb
    432 KB · Views: 81

lacampeona

Registered User.
Local time
Today, 08:16
Joined
Dec 28, 2015
Messages
392
Hello Arnelgp
Nice example. What about if the text field is very big? I know it must me some size limits?
Then the message box dont display all what is in the text field? it is possible to make scroll bar like in the text field?
Thanks
 

Attachments

  • is possible..JPG
    is possible..JPG
    111.2 KB · Views: 58
  • is ok.JPG
    is ok.JPG
    64.2 KB · Views: 53

lacampeona

Registered User.
Local time
Today, 08:16
Joined
Dec 28, 2015
Messages
392
So then that is possible to create? ok
thank you
 

Users who are viewing this thread

Top Bottom