Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Memo field shows only 3 lines in textbox

Posted on 2001-06-07
18
Medium Priority
?
344 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
ID: 6165468
is the maxlength property of the textbox = 0?
if not set it to 0.
0
 
LVL 1

Expert Comment

by:eab111098
ID: 6165506
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
ID: 6165876
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6166302
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
ID: 6166468
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
ID: 6166469
256 characters maybe...?  Change to a richtextbox and try again.
0
 
LVL 3

Expert Comment

by:nigelrowe
ID: 6166862
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
ID: 6166954
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
ID: 6166955
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
ID: 6166965
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
ID: 6168005
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
ID: 6168171
There is a get chunk method with DAO

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

Accepted Solution

by:
damienm earned 800 total points
ID: 6168184
There is a get chunk method with DAO

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

Author Comment

by:TurnerP
ID: 6177277
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
ID: 6178129
I have taken this to the database section since the problem lies in the SQL coding.
0
 
LVL 3

Expert Comment

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

Author Comment

by:TurnerP
ID: 6185691
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
ID: 7133441
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

927 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