Solved

Memo field shows only 3 lines in textbox

Posted on 2001-06-07
18
332 Views
Last Modified: 2012-08-13
Hi, I have a Access 97 memo field in a VB6 project set as the datafield for a text box.  Only the three lines of the memo are showing although I have multiline set to true and scroll bars to true. What could cause this? Thanks, Pamela
0
Comment
Question by:TurnerP
  • 5
  • 5
  • 2
  • +6
18 Comments
 
LVL 18

Expert Comment

by:bobbit31
Comment Utility
is the maxlength property of the textbox = 0?
if not set it to 0.
0
 
LVL 1

Expert Comment

by:eab111098
Comment Utility
turnerp, bobbit31 asks a good question, but further, you said, "only the three lines of the memo...". does this mean that there are only three lines of data and all of them are showing up, however, not scroll bars? or, does it mean that only three of the lines are showing and not scroll bars are present? if its the latter, try turning off the horizontal scroll bar. if its the foremore, then the scroll bars won't be displayed until either the data scrolls off the control to the right (horizontal scroll bar) or off the control at the bottom (vertical scroll bar). the scroll bars only show up when needed.

ed.
0
 

Author Comment

by:TurnerP
Comment Utility
Thanks for your comments. This is a weird problem. The maxlength property is set to 0. I understand about the scroll bars not showing up unless they're needed. There is no horizontal scroll bar on. Consistently only about 250 characters are showing up out of the memo. It makes me think it's treating it like a textfield for some reason, but it is a memo field and some memos are quite lengthly. I'm increasing the points on this one! This project is due and it's the last bug!
0
 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
hope u had checked with the access data and it contains all text i.e. more than 250 char or whatever.

cheers

0
 
LVL 5

Expert Comment

by:gwgaw
Comment Utility
Try this...

Dim lngOffset As Long
Dim lngTotalSize As Long
Dim lngChunkSize As Long

'Set the chunk size
lngChunkSize = whatever size you think need

'Copy the contents of the field by lngChunkSize
'chunks until the entire field is read.

'Get the size of the field
lngTotalSize = fldSource.FieldSize

Do While lngOffset < lngTotalSize
   Text1 = Text1 + fldSource.GetChunk(lngOffset, lngChunkSize)
   lngOffset = lngOffset + lngChunkSize
Loop

Also check if the field size is > than the textbox can hold.
0
 
LVL 1

Expert Comment

by:tommy_boy
Comment Utility
256 characters maybe...?  Change to a richtextbox and try again.
0
 
LVL 3

Expert Comment

by:nigelrowe
Comment Utility
MSDN...

The Text setting for a TextBox control is limited to 2048 characters unless the MultiLine property is True, in which case the limit is about 32K

If the data in the memo field is more than your three lines, then check the data string for an end of string character (ASCII 0).
0
 
LVL 2

Expert Comment

by:damienm
Comment Utility
I presume it is more to do with the data comming back from the recordset

you could do something like

msgbox rs.getchunk.. etc. to see what is being returned

(or debug.print rs...)

or msgbox len(rs.getchunk .. to see what lenght the recordset is bringing back.

If it is bringing back the right data then it is the textbox which has something wrong.  In which case try typing 0123456789 etc. into the textbox to see how many characters it allows.
0
 
LVL 2

Expert Comment

by:damienm
Comment Utility
I presume it is more to do with the data comming back from the recordset

you could do something like

msgbox rs.getchunk.. etc. to see what is being returned

(or debug.print rs...)

or msgbox len(rs.getchunk .. to see what lenght the recordset is bringing back.

If it is bringing back the right data then it is the textbox which has something wrong.  In which case try typing 0123456789 etc. into the textbox to see how many characters it allows.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 2

Expert Comment

by:damienm
Comment Utility
I presume it is more to do with the data comming back from the recordset.

you could do something like

msgbox rs.fieldname.getchunk.. etc. to see what is being returned

(or debug.print rs...)

or msgbox len(rs.fieldname.getchunk .. to see what lenght the recordset is bringing back.

If it is bringing back the right data then it is the textbox which has something wrong.  In which case try typing 0123456789 etc. into the textbox to see how many characters it allows.
0
 

Author Comment

by:TurnerP
Comment Utility
The textbox is working fine. It can hold large amounts of text and the vertical scroll bar works. As damienm presumed, it must be the data coming back from the recordset.

We are developing this project in DAO to accomodate older systems so I don't have a getchunk method. Is there a DAO way to troubleshoot the recordset? I have checked the data in the memo field of the database and it is all there.

Thanks, Pamela
0
 
LVL 2

Expert Comment

by:damienm
Comment Utility
There is a get chunk method with DAO

rs("fieldname").getchunk(0,1000)
0
 
LVL 2

Accepted Solution

by:
damienm earned 200 total points
Comment Utility
There is a get chunk method with DAO

rs("fieldname").getchunk(0,1000)
0
 

Author Comment

by:TurnerP
Comment Utility
I was wondering if the reason the abstract memo field is chopped of is because of the SQL statement used to create the recordset. Might it be because I am using DISTINCT for a memo field? Could you please suggest the proper way to word this? The following is the SQL statement I am presently using.


strSQL = "SELECT DISTINCT AuthorPub.MedlineAuthorName, Pub.Journal, Pub.Abstract, Pub.Citation , Pub.PubYear, Pub.Title, Pub.MedlineID From Pub, AuthorPub " _
& "WHERE Pub.medlineid = AuthorPub.MedlineID " _
& "AND (AuthorPub.MedlineAuthorName = '" & strAuthor & "') " _
& "ORDER BY Pub.PubYear DESC"
0
 

Author Comment

by:TurnerP
Comment Utility
I have taken this to the database section since the problem lies in the SQL coding.
0
 
LVL 3

Expert Comment

by:nigelrowe
Comment Utility
I'm betting on an illegal character in the database data...
0
 

Author Comment

by:TurnerP
Comment Utility
Actually, what is was is that you can't use DISTINCT with a memo field. So I tried a subquery, and... you can't use a memo field in a subquery. So, I used a completely different approach and created a separate recordset for the abstract. Probably, not the most elegant solution, but it worked. It is a small database. Thanks everyone for your help! Pamela
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi TurnerP,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept damienm's comment(s) as an answer.
**** good one dameiem, you hit the nail on the head!

TurnerP, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

9 Experts available now in Live!

Get 1:1 Help Now