Solved

Rich text display(including tab stops) from memo field

Posted on 1997-11-06
6
676 Views
Last Modified: 2012-08-13
I have a memo field to store text in a database.  I need to be able to have tab stops, special characters, color, and standard bold, italic and underline when displayed on a form and when user enters data.  How can this be accomplished? I have the Richtext control that comes with Visual Basic, but apparently I don't know how to use it.  I think this question is probably easy for someone who knows.
0
Comment
Question by:glover110697
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:cekman
ID: 1958861
The only way I know how to do this in Access is with a 3rd party tool. I know of one - Total Access Memo by FMS. (I am NOT affiliated with this company in any way). I ordered the Access 95/97 version and it is really cool. However - it has one MAJOR drawback: When printing the formatted memo fields on reports, there is no support for Can Grow/Can Shrink. This may cause problems depending on what you need to do for printing. The basic cost is somewhere around $99 for a single copy - but you need to by a royalty -free license to distribute it to multiple users. ($399???) The company's phone number is 703-356-4700. Their homepage is http://www.fmsinc.com.

Hope this helps - I haven't heard of anything else specifically for Access.
0
 

Author Comment

by:glover110697
ID: 1958862
I would like to continue this topic.  Although I can see where the  answer provided by cekman will work, I believe that there is a way to do it using the rich text ActiveX control from vb5.  I can get close but have yet to figure out how to disable tabbing on the entire form when the rtf control gets focus and re-enable it upon losing focus.  The examples in the vb5 component tools quide do not seem to work.
0
 
LVL 5

Expert Comment

by:cekman
ID: 1958863
I am interested in ActiveX control you're talking about. I have Access 97, but no t VB5 - should the control come with Access97 also?

What are some of the features that it is supposed to do?
Do you know if it supports CANGROW/CANSHRINK types of properties?

I could really use this feature in most of my databases, but the tool I mentioned previously just is too limited by the report drawback.

Thanks for any info you can give me!
CEkman
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:glover110697
ID: 1958864
To CEckman,
I don't have the reference with me at work but I don't remember it having can grow and can shrink properties.  It does have many other nice features. There is no 64k limit on it, it can be bound to a memo field, all of the text formating is supported (Ex. font,font size, color,underline, strike thru etc.  I have Access Pro 97 and the control did not come with it.  It did come with VB5 Pro.
If you get this tab thing to work please drop me a note
glover@lub002.lamar.edu
0
 
LVL 5

Accepted Solution

by:
cekman earned 50 total points
ID: 1958865
Here is the text from another KB article on how to insert tab stops into a RTF control in ACCESS97. From the code you emailed me - it didn't look like you were using the example below. I saw the KB article that had the code you used - this is different. I haven't tried it - good luck!

Article Follows.

PSS ID Number: Q170141
Article last modified on 06-16-1997
PSS database name: ACCESS
 
97
 
WINDOWS
 

======================================================================
---------------------------------------------------------------------
The information in this article applies to:
 
 - Microsoft Access 97
---------------------------------------------------------------------
 
SUMMARY
=======
 
Moderate: Requires basic macro, coding, and interoperability skills.
 
In a RichTextBox control, the default behavior of the TAB key is to move
the focus to the next control in the tab order of a form. This article
shows you how you can use the TAB key to insert a tab character into a
RichTextBox control.
 
The sample function ctlRichText1_KeyDown() traps for the TAB key in the
KeyDown event of the RichTextBox control. It prevents the control from
losing focus, and then uses the SelText property of the control to insert
the tab.
 
MORE INFORMATION
================
 
1. Create a new form not based on any table or query in Design view.
 
2. On the Insert menu, click ActiveX Control.
 
3. In the Insert ActiveX Control dialog box, select Microsoft RichText
   Control, and then click OK.
 
4. Set the control's Name property to ctlRichText1.
 
5. Add two text boxes to the form.
 
6. On the View menu, click Code. Type the following procedure:
 
      Private Sub ctlRichText1_KeyDown(KeyCode As Integer, _
            ByVal Shift As Integer)
         Dim rtf As RichTextBox
         Set rtf = Me!ctlRichText1.Object
         If KeyCode = 9 Then  ' TAB key was pressed.
            ' Ignore the TAB key, so focus doesn't
            ' leave the control
            KeyCode = 0
            ' Replace selected text with the tab character
            rtf.SelText = vbTab
         End If
      End Sub
 
7. Switch the form to Form view. Note that pressing the TAB key now
   inserts a tab character in the RichTextBox Control. To exit the
   RichTextBox control, use your mouse pointer. Note also that the TAB
   key behaves as it normally does when one of the text boxes has the
   focus.
 

0
 

Author Comment

by:glover110697
ID: 1958866
Carla,
It works! Thank you so much! <big grin>.  Now if I can just get use to "twips" for specifing widths and margins, etc. I think I am going to like programming in VB and Access. (I have been a COBOL programmer for over 25 years and I am teaching myself VB and Access.)
I could not be more pleased with your help.  
Thanks again.
Ray Glover       glover@lub002.lamar.edu
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question