Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memo Field Length issue

Status
Not open for further replies.

sk8er1

Programmer
Jan 2, 2005
229
US
I have a memo field in a table, I entered more than 254 characters into it. I load the memo data into a list box for the user to select it. Then I build an sql statement

like this....
strSQL = "SELECT * FROM Questions_Responses WHERE question = '" & lstSearch.Column(1, itm) & "'"


Problem is if the length of the value in lstSearch.Column(1),itm) is > 254 characters, the select will not bring in the record....how do I handle this...


 
i suspect that the list box is cutting off the later chrs...

you could try to use like and * to find your question, but that's not 100% reliable...

--------------------
Procrastinate Now!
 
You are using the entire question which could have more than 254 (255?) characters as the search criteria? Is this necessary? Is there not some way of searching on keywords or something that wil not be affected by truncation of the main question?

Alternativley, it appears that you are using the question in the list to select a record for viewing (am I right?). This should surely be done using an index field that is also in the list but hidden, and use the value of that to select the record.

Have fun! :eek:)

Alex Middleton
 
Hi Alex,

The user selects the choice from a list box, and it will appear on a form letter.
Can you show me what you are talking about regarding the index....

Thanks
 
OK, is it possible to add the questions in full to a table with an autonumber primary key, then fill the listbox with a query which puts the PK in the first column and the text from the question (or the 1st 255 chars) into the second column (I presume they will get the jist of the question from the first 255 chars?). Then use the value from the first column (hide this by setting ColumnCount to 2, BoundColumn to 1, and the ColumnWidths to somehting like "0cm;12cm") to get the full question text and put it on the letter?

Have fun! :eek:)

Alex Middleton
 
AlexMidd is right on. Listboxes can not be used as you are trying to do. It is a very simple matter to use the listbox to display a textual index of the message and, when the user selects the index, fill a textbox with the full contents of the memo field. A button could act as the trigger any action.

---------------------
scking@arinc.com
---------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top