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 in LIst Box ???/ 2

Status
Not open for further replies.

jester4281

IS-IT--Management
Sep 12, 2002
160
US
Is it possible to utilize a memo field in a listbox, without it showing MEMO. I know you can do this in a grid but I want the listbox function.
 
GriffMG,
"trim(brandissueresult.issue),issueid,brandid" is ok, other forms are not!

I agree that is very odd behaviour...I wonder if it is the same in VFP 8 or if MS VFP Team fixed that?

jester4281,

You may want to rethink your solution...if the memo field Issue ever contains more than 254 characters I think you will get a string too long error, that is why in my code I put a left(issue,254) as issue...but maybe you know for certain that the field will never be longer than 254 characters.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Slighthaze

I am still with VFP 5 and 6, so who knows.

I would think a bit of imagineation could derive a UDF that sorts this.

Memo fields in listboxes - is that a good idea?

Regards

Griff
Keep [Smile]ing
 
There may be instances where the characters are more then 254, what method should I try to solve possible issues
 
Take the first 100 chars or so is my first thought!

Regards

Griff
Keep [Smile]ing
 
jester4281,

There may be instances where the characters are more then 254, what method should I try to solve possible issues

With all due respect, I am getting a little confused by your questions. I posted working code example for you up above. Do you not see the post or is there something you don't understand about my post? I put comments in the code for you to explain the length restriction. I also explained in my last post (where I warned you about the length restriction) that I used the line left(issue,254) as issue in order to keep from having the String is too long error. Are you unsure how to run my code example given above or maybe don't understand how it pertains? I am not trying to be flippant, I really am just having a hard time following.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
I tried your method also, but it returned the same as the method I was already using in the post I posted stating I got it. I was hoping there was a method that would not limit the character lenght to 254, sorry for not acknowledging your response, I was just trying to find a method that would show all and since your produced the same as mine and Griff's I went back to the other method. Sorry for not acknowledging you.
 
jester4281,

My interest is in good code and workable solutions. And there is a difference between the solutions proposed here.

thisform.listbox1.rowsource="brandissueresult.issueid,brandid,trim(issue)" &&Results in a syntax error

select issue AS issuenew... &&Potential string too long error

left(issue,254) as issue &&Workable solution with no error

...now there may be other solutions for this, but of the ones proposed I think the last one is the only truly workable solution. Having said that I would like to go back to what GriffMG asked earlier "Memo fields in listboxes - is that a good idea?" and my answer to that would be "Usually I would say no". Listboxes just weren't made for displaying the contents of memos. It may be a case where just because you CAN do something it doesn't mean you SHOULD do something. That's my two cents for what it's worth.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
I appreciate your two cents, and usually I would have used a grid to accomplish what I am trying to do but due to the user only needing the memo field in view and I need only one field hidden with ID I figured it would be easier to setup a list box instead of having to set focus to my id field when the user clicks the memo field in grid, locking the values in grid and all the other secure features I would have had to do.

Then when the user clicks the memo field value they want I have it populating another list box with another memo value and I need it to be on the fly and possibly the user changes his mind a couple times most commonly when you issue the code to a grid more then a couple times you end up losing your gird formats and sometimes the code wont accomplish what you want.

Plus with the nature of my users I need the look of a list box, they do not like the grid and I want to make it easier on myself by making it easier on them. I am aware of the possible limitations I maybe looking into and I did try your code, but in my mind they are all only giving me the 254 character limit, so all the solutions seem to work.

Sorry for once again over looking your comments and I appreciate your advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top