• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 348
  • Last Modified:

Memo field shows only 3 lines in textbox

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
TurnerP
Asked:
TurnerP
  • 5
  • 5
  • 2
  • +6
1 Solution
 
bobbit31Commented:
is the maxlength property of the textbox = 0?
if not set it to 0.
0
 
eab111098Commented:
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
 
TurnerPAuthor Commented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
Valliappan ANSenior Tech ConsultantCommented:
hope u had checked with the access data and it contains all text i.e. more than 250 char or whatever.

cheers

0
 
gwgawCommented:
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
 
tommy_boyCommented:
256 characters maybe...?  Change to a richtextbox and try again.
0
 
nigelroweCommented:
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
 
damienmCommented:
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
 
damienmCommented:
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
 
damienmCommented:
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
 
TurnerPAuthor Commented:
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
 
damienmCommented:
There is a get chunk method with DAO

rs("fieldname").getchunk(0,1000)
0
 
damienmCommented:
There is a get chunk method with DAO

rs("fieldname").getchunk(0,1000)
0
 
TurnerPAuthor Commented:
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
 
TurnerPAuthor Commented:
I have taken this to the database section since the problem lies in the SQL coding.
0
 
nigelroweCommented:
I'm betting on an illegal character in the database data...
0
 
TurnerPAuthor Commented:
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
 
DanRollinsCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 5
  • 2
  • +6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now