Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Rich text display(including tab stops) from memo field

Posted on 1997-11-06
6
Medium Priority
?
700 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 200 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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.

715 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