473,385 Members | 1,474 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.

Allow append data only to memo field

35 32bit
Hello,

I have a user that wants to allow data entry in a memo field. He does not want to allow changes to existing text in the same field, but only allow entry of new text. He would also like any existing text to be viewable as well.

Does anyone know of code that could accomplish this?

Thank you in advance!
Mar 10 '10 #1

✓ answered by missinglinq

Working with medical/legal records, I've used this hack for a number of years. A second, unbound textbox (TempDataBox) is used to enter the data into. This textbox is originally hidden, and when the command button (IndirectDataInput) is clicked, it appears. Data is entered, and when the command button (now captioned “Commit Data”) is clicked again, the entered data is added to the memo field.

Now, in this example, there are two memo fields, but only one is bound, since the other memo field is simply a temporary holding area. The memo field is also locked so that all data entry has to be done thru the temporary textbox.

TempDataBox is unbound, and in the Property Box its Visible Property is set originally set to No. I place mine side by side with CommentsField so the user can refer to what's currently in the CommentsField section while entering new notes.

CommentsField is bound to the underlying table/query, and its Locked Property is set to Yes.

Place a command button on the form. Name it IndirectDataInput and in the Properties Box set its Caption to “Add New Data.”

Now use this code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub IndirectDataInput_Click()
  2. If IndirectDataInput.Caption = "Add New Data" Then
  3.    TempDataBox.Visible = True
  4.    TempDataBox.SetFocus
  5.    IndirectDataInput.Caption = "Commit Data"
  6. Else
  7.    IndirectDataInput.Caption = "Add New Data"
  8.    If IsNull(Me.CommentsField) Then
  9.       If Len(Me.TempDataBox) > 0 Then
  10.         Me.CommentsField = Me.TempDataBox
  11.         Me.TempDataBox = ""
  12.         TempDataBox.Visible = False
  13.       Else
  14.         TempDataBox.Visible = False
  15.       End If
  16.     Else
  17.       If Len(Me.TempDataBox) > 0 Then
  18.        Me.CommentsField = Me.CommentsField & vbNewLine & Me.TempDataBox
  19.        Me.TempDataBox = ""
  20.        TempDataBox.Visible = False
  21.       Else
  22.        TempDataBox.Visible = False
  23.       End If
  24.  
  25.     End If
  26. End If
  27. End Sub
Replace CommentsField with the actual name of your textbox and keep the rest of the control names as given.

Welcome to Bytes!

Linq ;0)>

4 5216
missinglinq
3,532 Expert 2GB
Working with medical/legal records, I've used this hack for a number of years. A second, unbound textbox (TempDataBox) is used to enter the data into. This textbox is originally hidden, and when the command button (IndirectDataInput) is clicked, it appears. Data is entered, and when the command button (now captioned “Commit Data”) is clicked again, the entered data is added to the memo field.

Now, in this example, there are two memo fields, but only one is bound, since the other memo field is simply a temporary holding area. The memo field is also locked so that all data entry has to be done thru the temporary textbox.

TempDataBox is unbound, and in the Property Box its Visible Property is set originally set to No. I place mine side by side with CommentsField so the user can refer to what's currently in the CommentsField section while entering new notes.

CommentsField is bound to the underlying table/query, and its Locked Property is set to Yes.

Place a command button on the form. Name it IndirectDataInput and in the Properties Box set its Caption to “Add New Data.”

Now use this code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub IndirectDataInput_Click()
  2. If IndirectDataInput.Caption = "Add New Data" Then
  3.    TempDataBox.Visible = True
  4.    TempDataBox.SetFocus
  5.    IndirectDataInput.Caption = "Commit Data"
  6. Else
  7.    IndirectDataInput.Caption = "Add New Data"
  8.    If IsNull(Me.CommentsField) Then
  9.       If Len(Me.TempDataBox) > 0 Then
  10.         Me.CommentsField = Me.TempDataBox
  11.         Me.TempDataBox = ""
  12.         TempDataBox.Visible = False
  13.       Else
  14.         TempDataBox.Visible = False
  15.       End If
  16.     Else
  17.       If Len(Me.TempDataBox) > 0 Then
  18.        Me.CommentsField = Me.CommentsField & vbNewLine & Me.TempDataBox
  19.        Me.TempDataBox = ""
  20.        TempDataBox.Visible = False
  21.       Else
  22.        TempDataBox.Visible = False
  23.       End If
  24.  
  25.     End If
  26. End If
  27. End Sub
Replace CommentsField with the actual name of your textbox and keep the rest of the control names as given.

Welcome to Bytes!

Linq ;0)>
Mar 10 '10 #2
TheSmileyCoder
2,322 Expert Mod 2GB
My solution would be to have a unbound text box, and then when user clicks a button "Add to existing text" the text is transferred.
Assuming your bound textbox is called tb_FullStory and we call the unbound textbox tb_Input I would use something like this:

Expand|Select|Wrap|Line Numbers
  1. If Me.tb_Input & "" <>"" Then 'Check that something is in field
  2.   'Add the new input the field.
  3.   Me.tb_FullStory="[" & Date() & "]" & vbnewline & _
  4.                   Me.tb_Input & vbnewline & vbnewline & _
  5.                   Me.Tb_FullStory
  6. End If
  7.  
I added some Date info to the textbox, but you can just remove that if its not usefull for your application. I also made it so the new text is placed before the old text, but you can also just switch that aroud.
Mar 10 '10 #3
rhonda6373
35 32bit
These are great ideas. Thank you so much and they are easy answers to understand. I will try these out.

Glad to join!
Mar 10 '10 #4
rhonda6373
35 32bit
These worked great! Thanks!
Mar 12 '10 #5

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

Similar topics

1
by: ivan | last post by:
Access 97 I have a memo field in a footer on a subform. When I print the form, all data is printed except the data that was entered into the memo field. The memo field itself is printed (the...
1
by: Rose | last post by:
I have an access 2000 database. In it I have a table OPEN Items which has a field Issue that is setup as a MEMO field. I am trying to append information from another table with the same setup,...
2
by: martinjeffreys | last post by:
Hello I'm using an append query from an Access front end to add data to a back-end SQL table. It all works OK - except a Memo field is being truncated to 765(ish) characters. Any thoughts...
3
by: Helgardh | last post by:
I have a linked table (Access 2003) to an Outlook inbox. The body of the e-mail messages are in a memo field. My problem is that I need to "read" the memo and find data on certain lines. The...
5
by: kotowskil | last post by:
A report has a subform. The subform is set to datasheet view and its RecordSource is a select query that includes a memo field from the source table. The memo field's Can Grow property is Yes,...
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
0
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may...
7
by: ARC | last post by:
This is taken from the "What's New in Access 2007" page. However, I've looked through all the properties of a text field memo box, and cannot find the append only option. Does anyone know how to...
3
by: nujcharee | last post by:
Hi I have a series of queries, I have a number of temp tables which I use as templates for my data. I start with 1. Delete the data in a temp table 2. Use append query to fill the temp table...
1
by: Bull | last post by:
Hi, Is there a way (besides Case or IIf), to type a value into field1 and have that value added to the value inside a memo or text field? Example: memo/text field has: hello in field1 i...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.