Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listing the contents of a memo field in a combobox
Message
From
29/06/2001 13:55:32
 
 
To
29/06/2001 13:20:46
Robert Herrmann
Tx Dept. of Health - Cancer Registry
Austin, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00525262
Message ID:
00525296
Views:
12
>Question.. I have 3 tables I am putting into 3 dif. comboboxes.. they all have memo fields in the tables. Unfortunately, the data in the memo fields is what I need displayed in the dropdown combobox. when I just select it in properties for rowsource = 6 the combobox listing just says "memo" and not the actual info in the memo. Anyway I can set it up so that the combobox will list the information in the memo field?
>
>TIA

Hi Robert,

If you know the width of each line of the memo field. You could try the following to get the info from the field into an array. Then use the array to populate the combobox.

THISFORM.yourcombo.ROWSOURCE = ""
* This will hold the number of rows in the meo field
ntemplines = MEMLINES(memofield)
* Set the desire row with
SET MEMOWIDTH TO 'your desired width'
* Loop through all the rows
FOR nlinecntr = 1 TO ntemplines
* Store the contents of the row into this variable
ctempstr = MLINE(memofield,nlinecntr)
* Redimention the array to hold an other element.
DIMENSION yourarray(nlinecntr)
* Populate the array element.
yourarray(nlinecntr) = ALLTRIM(ctempstr)
ENDFOR
* Bind the array
THISFORM.yourcombo.ROWSOURCE = 'yourarray'
* Refresh it's display.
THISFORM.yourcombo.REQUERY

If you require multiple columns. You'll have to sure of the memo field's format.

HTH
Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform