Solved

Rich text display(including tab stops) from memo field

Posted on 1997-11-06
6
664 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:glover110697
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now