473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Apostrophe or single quote in a text field with rich text format does not take

22
I have an unbound text box called Notes on a MS Access 2007 form with the Text Format property set to Rich Text.

The underlying database has a Memo field called NOTES with it's property set to Rich Text.

When I try to enter some text enclosed in apostrophes/single quotes (eg. 'test') into the form field Notes and press my save button to do an update I run into a problem as enclosed in the text file.

Is there anyway to capture the apostrophe/single quote into the table and retain all the RTF features ? Need help on this.

Here is my update statement
Expand|Select|Wrap|Line Numbers
  1. SQLUpdMain = "UPDATE CA_NIGHTLY SET AUDIT_DATE =#" & Me.txt_main_aud_date & "#," & "AUDIT_STATUS =" & "'" & Me.cbo_main_aud_status & "',"
  2. SQLUpdMain = SQLUpdMain & "NOTES =" & "'" & Me.txt_main_Notes & "'" & ",OVERPAID =" & Ovp_Cur & ",UNDERPAID =" & Unp_Cur
  3. SQLUpdMain = SQLUpdMain & ",UPDATED_BY =" & "'" & strUser & "'," & "UPDATED_DATE =#" & CurrentDate & "#"
  4. SQLUpdMain = SQLUpdMain & " WHERE AUDIT_CLAIM_NUMBER =" & [Forms]![frmMain]![txt_main_aud_clmno].[Value]
  5.  
Attached Images
File Type: jpg ErrorMessage.jpg (3.6 KB, 552 views)
Jul 12 '10 #1

✓ answered by vb5prgrmr

Expand|Select|Wrap|Line Numbers
  1. strValToUpdateInsert = Replace(RTB.RTFText, "'", "''")
  2.  
This will make things like can't look like can''t but when you retrieve it, it will come out right (can't) as it will be stored with only the single tick...



Good Luck

2 5828
vb5prgrmr
305 Expert 100+
Expand|Select|Wrap|Line Numbers
  1. strValToUpdateInsert = Replace(RTB.RTFText, "'", "''")
  2.  
This will make things like can't look like can''t but when you retrieve it, it will come out right (can't) as it will be stored with only the single tick...



Good Luck
Jul 13 '10 #2
p4willi
22
@vb5prgrmr
Works - sweet... Thanks much
Jul 13 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Zachovich | last post by:
' hi all ' suppose i have this: Dim strText As String = "Hello! <b>this</b> text <i>is</i> formatted" ' NOTE: i want the "this" to be bold and the "is" italic ' but when i do this:...
5
by: S Shulman | last post by:
Hi I am looking for a way to insert formated text from the Rich Text Box to a Word Document That way the user will not have to Re-Format the text Thank you in advance, Shmuel Shulman
0
by: lligogogo | last post by:
I would like create a text input field in a <form>, in asp, only one input field, the user could type in the data, or user could select the data from a dropdown box? I don't like to use a Combo...
2
by: VB Programmer | last post by:
In my dev environment the single quote/apostrophe shows up fine. When I publish the site all the single quotes are missing. Any ideas why? Is there a special character I have to use for the...
6
by: anirban | last post by:
hellow how can i do the following job i am using rich text box 6.0 i write something in the rich text box how can i save the file in disk as a text document which can easily open...
2
by: John | last post by:
Hi How can I add some txt in red and other in grey to a rich text control? Thanks Regards
1
by: pooba53 | last post by:
I have a rich textbox control and a long string of characters that I will assign to it's .text property. How can I bold some characters and apply italics to others?
6
by: Pat.Rick | last post by:
Hi Freinds, I need a control / script to be able to give the user to edit a TEXT field online on browser for hyper text and rich text format, just like most of the email and contect editor allow...
3
MindBender77
by: MindBender77 | last post by:
Hello All, The following SQL string fails because astrOrdernotes(8) has a single quote in the field. Example Henry O'Smith. The data type for this field is a string but, I keep getting a syntax...
2
by: radforms | last post by:
Hi All, just wondering someone out there could help me solve a little problem in my mysql database: Table 1 Name: wp_wpsc_product_files Fields: ID, Name, Description, Additional_Description ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.