Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to show memo field in textbox
Message
 
 
To
11/10/2007 15:01:38
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01260360
Message ID:
01260390
Views:
8
>>>I would like to show memo field in textbox object. I have tried this
>>>SELECT SUBSTR(memofield,1,40) as field1 FROM tableA INTO CURSOR aa
>>>
>>>Thisform.mygrid.Column1.text1.ControlSource = 'aa.field1'
>>>
>>>The problem is the content of Column1 is showed as Memo, not as SUBSTR of memo field
>>
>>Something is wrong here. I think the field is going to be character field, since you substracting first 40 characters, so if you assign column's controlsource it should be just field, not a memo. Perhaps you have aa table somewhere in the path with the Memo field.
>>
>>Try to use different name for the cursor, same, curMyGrid.
>
>Yes, I thought that substring of memo field was character field, but it is not. The result is showed as memo field.

If VFP9 you can use CAST function, but I always thought that substracting is enough.

Try

select substr(myMemo,1,40) as myCharField from myTable into cursor curTest
=afields(laFields)
=messagebox(laFields(1,2))

You can also use a following trick in VFP8:

select space(40) as myCharField from myTable where 1=2 ;
union ;
select substr(myMemo,1,40) as myCharField ....
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform