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.

Is it possible to indent a memo field?

Hello. I have a memo field that has is timestamped. I need the field to indent past the date and time.

The field looks like this:

10/11/2010 2:48:14 PM Talked to lady stated that
Defendant was at place of employment yesterday.....
10/11/2010 2:48:17 PM Status is: Closed

I want it to look like this: (Minus the'------')

10/11/2010 2:48:14 PM Talked to lady stated that
--------------------------------Defendant was at place of
--------------------------------employment yesterday.......
10/11/2010 2:48:14 PM Status is: Closed.

I hope you can understand what i'm trying to do. And I thank you for looking at my question. (I'm using Access 2007)
Oct 12 '10 #1
6 7184
jimatqsi
1,271 Expert 1GB
Thomas,
Hello, welcome to Bytes.

You cannot indent only the first line of a memo and not the remainder, or vice versa. So you'll need to split the memo into two parts, a date part and a part without the date.

You will need two text fields instead of one, the first for the date and the second for the memo. Is this a report or a form you are looking at? In a report you would add this code to the Detail OnFormat event:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. Dim intDateEnds As Integer
  3.  
  4. On Error GoTo Err_DetailFormat
  5.  
  6. intDateEnds = InStr(Me!memNote, "M ") ' find the end of the date/time PM or AM
  7. Me!txtDate = Left(Me!memNote, intDateEnds) ' get the date and time only
  8. Me!txtNote = Mid(Me!memNote, intDateEnds + 2) ' get the note after the date/time
  9.  
  10. Exit Sub
  11.  
  12. Err_DetailFormat:
  13.     MsgBox Err.Description
  14.     Resume Next
  15.  
  16. End Sub
  17.  
In this code
memNote is a text box bound to the data field. It should be invisible and the Can Grow property should be false
txtDate is the text box to contain the date field only
txtNote is the text box to contain the part of the note without the date. The Can Grow property should be true, and probably the Can Shrink property also, but that is up to you.

If you are working with a form and not a report, things are trickier because you cannot have unbound text boxes within the detail. You would have to split the content up in the query and then bind the separate parts to text boxes.

Hope this helps,
Jim
Oct 12 '10 #2
Thanks Jim for you fast answer.

Using the code works only on the first line of the memo field. The rest of the field on the report is the same. Maybe I'm doing something wrong.

Thomas
Oct 12 '10 #3
jimatqsi
1,271 Expert 1GB
I don't see how that can be. If the memo is in a separate text box, the top line of the memo cannot be more or less left or right than the following lines of the memo. The text box is a rectangle with the same bounds on the left and right from top to bottom.

Can you attach a pdf of your report so we can see the result? I think I am not understanding something about your situation correctly.

Jim
Oct 15 '10 #4
NeoPa
32,556 Expert Mod 16PB
Jim's provided an interesting and innovative solution that directly matches your question and situation.

I would suggest you go further and store the date separately in your data. It makes little sense to store it as part of the Memo field, and no good comes from it.
Oct 15 '10 #5
Freddyboy
2 2Bits
@NeoPa
I would try in your text field: FormatDate(your date field formatted to your liking) & Chr(13) & Chr(10) & " " & next datafield.

To over simplify, Textbox = Date & Chr(13) & Chr(10) & datafield

This will line feed your data after displaying the date. the Chr characters line feed, then your data follows the spaces entered by using & and then your textfield
Feb 18 '22 #6
NeoPa
32,556 Expert Mod 16PB
I'd be inclined to avoid that myself. Read my earlier post for my warning against storing the data in a Memo field at all.

If, for whatever reason, you do need to include a Carriage Return / Line Feed sequence into your data from VBA then there are two constants (vbNewLine & vbCrLf) that contain the whole sequence and make working with it easier & clearer for anyone reading it.

Mixing two disparate entities together is a particularly clumsy way to approach handling such data and should be avoided where possible.
Feb 18 '22 #7

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

Similar topics

3
by: GorDon | last post by:
Hi, I have a report based on a query. The query grabs a memo field from my main table, yet when I display the memo field in the report it truncates the memo field (the field needs to hold more...
16
by: Mark | last post by:
Hello. I am attempting to use AppendChunk() to write binary data to a memo field in Access 2000. My initial call to AppendChunk() results in a data type conversion error. Any suggestions? Here...
2
by: alexsg | last post by:
I'm setting up a resolutions database where each resolution will be copied from Word documents and pasted into a memo field. The resolution will be in the form: Resolution title <cr> Project no...
1
by: alexsg | last post by:
A little while ago Ron P kindly responded to my inquiry on how to copy the first line of memo field into a text field, using a query: left(,instr(1,,vbCrLf)-1) This is great, but I would like...
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...
2
by: Teresa L | last post by:
I am using Access 2003. I have a memo field that I have put into a report. My problem is that the report will only show a specific amount of characters in the report. It does not display the...
4
by: John | last post by:
Is it possible to center a memo field value vertically? I use a memo field for printing address labels and I would like the addresses to show up centered vertically. Thanks, john
5
by: cosmodango | last post by:
I have spent several days on this. I hope someone can help me. I am using Acccess 2000. I have a memo field where I have cut and pasted bulleted/numbered lists from Microsoft Word. I want to...
4
by: Bob Alston | last post by:
My client insists that the printed copy of text entered into a memo field have EXACTLY the same layout as it appears on the screen. I found I had to eliminate the vertical scroll bar. Then I...
0
by: munkee | last post by:
Right this is purely an idea, I have an infopath form which I wish to use to populate my access database. The database and form require the usage of memo fields, basically long text over 255...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.