Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML stored in memo field

Status
Not open for further replies.

simmi0505

Technical User
May 23, 2005
5
AU
Hi

I am trying to store HTML code in a memo field using the following code.

Code:
Me.LongDescription.Value = Me.HTM_WRK1 & Me.HTML_Desc1 & Me.HTM_WRK2 & Me.HTML_Desc2 & Me.HTM_WRK3 & Me.HTML_Desc3 & Me.HTM_WRK4

Where the HTML_Desc1, HTML_Desc2 and HTML_Desc3 are text boxes that users can enter. HTM_WRK1, HTM_WRK2, HTM_WRK3 and HTM_WRK4 are preset HTML code that doesnt change.

OK now the part I have trouble with. This all works great if I type in the HTM_WRK* code to a field in the form but I can't workout how to store HTML code as a default or in code, because it includes " in the middle.

Any ideas on how to do this would be appreciated. Thanks.

 
Here is something I have done sometime back. I don't keep the HTML code in the textbox Just add them when you enter to the textbox where I need the entire link
Code:
Private Sub FullLink_Enter()
    Dim a, b, c, d, e, f, g, h, i As String
    a = "<li>"
    b = "<a href="""
    c = """target=_blank> "
    d = "</a>"
    e = "</li>"
    i = a & b & Me.LinkID.Value & c & Me.LINKTEXT.Value & d & " " & Me.TALE.Value & e
    Me.FullLink = i
End Sub
LinkID
Code:
[URL unfurl="true"]http://www.mvps.org/access/[/URL]
LinkText
Code:
The Access Web
TALE
Code:
One of the best place for Access Solutions

All togethe it comes like
Code:
<li><a href="[URL unfurl="true"]http://www.mvps.org/access/"target=_blank>[/URL] The Access Web</a> One of the best place for Access Solutions</li>

________________________________________________________
Zameer Abdulla
Help to find Missing people
Do not cut down the tree that gives you shade.
 
Hi

I am still having trouble with this. Where the HTML code includes " in the middle of it it still gives me an error "Expected: end of statement" just after the ".

Any thoughts on how to get around this?

Just need the default HTML code (few pages of it) stored somewhere where I can pick it up and combine it with user entered fields - dont care if its stored in the form as a default value, a table, code, etc.

Thanks
 
Some strings you need extra double qoutes. like
Code:
    b = "<a href="""
    c = """target=_blank> "
supposed to be
Code:
    b = "<a href="
    c = "target=_blank> "


________________________________________________________
Zameer Abdulla
Help to find Missing people
Do not cut down the tree that gives you shade.
 
Thanks but am still trying to understand.

If I want the HTML
Code:
<P><TABLE style="BORDER-RIGHT: medium none;

stored as value A

What is the code? I have tried different variations on

Code:
a= ""<P><TABLE style="BORDER-RIGHT: medium none; ""

Thanks





 
This may be able in code not storing in table.
Code:
a = "<P><TABLE" & "style=" & BORDER - Right: medium none & ";"
You are just splitting and concatenating it at runtime.

If you want to store in table you need to split it in many parts.
Code:
a1 = "<P><TABLE"
Code:
a2 = "style="
Code:
a3 = "BORDER - Right: medium none"
Code:
a4 = ";"
This part not tested..



________________________________________________________
Zameer Abdulla
Help to find Missing people
Do not cut down the tree that gives you shade.
 
Thanks

Have gotten to the bottom of it. Not the cleanest solution but seems to be OK.

The answer to my question above turned out to be
Code:
a = "<P><TABLE style=""BORDER-RIGHT: medium none;"

Thanks
 
Hallo,

You got there in the end, but that's the only way.
To include a " character in a constant string expression, you have to write it twice, ""

- Frink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top