473,394 Members | 1,944 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,394 software developers and data experts.

Updating Memo Field from form Control

I have a form with an unbound control called RevevantDateNotes. This is used to gather and update information stored on a table field of type Memo, with the same name (RevevantDateNotes).

The After Update [Event] is shown below:

I need to store an email (cut and past) of a resignation letter. When I cut and paste a letter into the form field, I get the following error with a portion of the letter embedded in the error message:

3075 - Syntax error in query expression "Date Wed 29 Oct 21:37:57 [about 255 characters of the letter, ending with single quote] . . . team. I expec'.

There are no single or double quotes embedded in the letter.

Looks like the statement "Dim RelevantDateNotes As String" limits me to 255 characters as when I remove spaces, a few more characters of the letter show up in the error message. When I dhortent he inout, it works without an error message.

How can I store the entire letter in the memo field.

-------------- Event Code ------------
Expand|Select|Wrap|Line Numbers
  1.  Private Sub RelevantDateNotes_AfterUpdate()
  2. On Error GoTo Err_RelevantDateNotes_AfterUpdate
  3.  
  4. Dim Member_ID As Integer
  5. Dim RelevantDateNotes As String
  6.  
  7. RelevantDateNotes = Me.RelevantDateNotes
  8. Member_ID = Me.Member_ID
  9.  
  10. 'update table with current notes
  11. temp_sql = "UPDATE tbl_J_MemberDates "
  12. temp_sql = temp_sql & " SET RelevantDateNotes = '" & RelevantDateNotes & "' "
  13. temp_sql = temp_sql & " WHERE mmMember = " & Member_ID & " "
  14.  
  15. DoCmd.SetWarnings False
  16. DoCmd.RunSQL (temp_sql)
  17. DoCmd.SetWarnings True
  18.  
  19. Exit_RelevantDateNotes_AfterUpdate: ' Label to resume after error.
  20. Exit Sub ' Exit before error handler.
  21.  
  22. Err_RelevantDateNotes_AfterUpdate: ' Label to jump to on error.
  23. MsgBox Err.Number & " - " & Err.Description ' Place error handling here.
  24. Resume Exit_RelevantDateNotes_AfterUpdate ' Pick up again and quit.
  25.  
  26. End Sub
Dec 15 '08 #1
1 2047
Disregard. The above code works.
Dec 16 '08 #2

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

Similar topics

2
by: PMB | last post by:
Thank you in advance for any and all assistance. I'm trying to input data from strings to a memo field. I would like to know how to check first to see if there is text there currently and if so...
2
by: NewBob | last post by:
Since Access automatically highlights all of the text in a text control (I use it to hold data from a memo field) when the control is activated, I've added the following code to put the cursor at...
4
by: intl04 | last post by:
I have a memo field that is included in some Access reports I created. Is there some way for the memo field to display nicely formatted text, with line breaks between paragraphs? Or is it necessary...
1
by: j.mandala | last post by:
I have a memo field in an appointment application that stores session notes for group psychotherapy sessions. Each attendee of the group has an appointment record. I want to be able to write a...
4
by: Mark Reed | last post by:
Hi All, here is what I am trying to achieve. I have a memo field on a form which users will need to add to as and when. I do not want them to be able to edit information which already exists...
7
by: midlothian | last post by:
Does using CStr on a memo field truncate it to 255 characters? Seems like this is happening with some data in my tables. Is there a way around this?
15
by: sara | last post by:
I have a Memo field in a table to hold notes from a conversation a social worker has had with a client (this is for a non-profit). If the user needs to update the memo field, I need to find the...
10
by: ARC | last post by:
This is mainly a speed question. In this example: I have a QuotesHdr table that has a few memo fields. If these memo fields are used extensively by some users, and if their are a large number of...
0
by: carlton129 | last post by:
Hi! I am trying to copy the current form and subform to the clipboard with the click of a button so that I can paste it in another application. So far, I can get all of the Form info together into...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.