Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To: Use LISTBOX to select records to view/edit elsew
Message
From
16/08/2000 10:04:00
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00405098
Message ID:
00405475
Views:
34
Barbara,

Hi!! Actually, the listbox has only one of about 20 fields in it... the name. I also have an index in the file for
the name field as well. In the DE on the form, I set the ORDER for the file (apmas) to the name of the field
(name). The listbox has one column (name). The rowsourcetype is set for 6-Fields and the rowsource is
set for apmas.name. Controlsource is blank and bound to is false.

This works, sort of. It moves the record pointer alright but the displayed list isn't sorted. I thought that was all
I needed to do to sort the list???






>Peter,
>I mostly use grids for this type of editing, but...
>
>a) Is all the data in the table going to show in the list? If not could you use a view?
>
>b) Why can't you use an index to sort the list alphabetically? Or 'Order' if it's a view? Then the list can do its own search with IncrementalSearch=.T.
>
>c) Be sure the field you are searching by (the one that's alphabetized) is the first field showing. If another field is the one used for editing the record then set the BoundColumn value to that field. For example, if you have RowSourceType = 2 (Alias) and RowSource = MyView.lname, fname, idfield, then you'd set BoundColumn to 3 to return the idfield value. (And set BoundTo=.T. if the idfield is numeric).
>
>Then in your InteractiveChange, you'd take the Listbox VALUE, which would be the IDField of the selected item, and search the underlying table for that ID value to edit.
>
>HTH
>Barbara
>
>>The project I am working on needs a form with a pageframe. The first page needs to have a list
>>of the "names" from a file and a display area that shows "detail" from the current record. When
>>the user needs to edit or add info, they go to page 2 and make changes there.
>>
>>I thought I'd use a listbox on the first page. I got this to work by using a recordsource of 6-fields,
>>but the list needed to be sorted alphabetically. I ended up switching it to SQL and using...
>>
>>select name, apmasid from apmas into cursor curLstRec order by name
>>
>>in the record source. When I did this, of course I lost the feature of keeping the highlighted
>>record current. I have tried to use a InterActive change to seek or indexseek the apmas file
>>based on the unique apmasid. This is giving me erratic information and jumps at best. I also
>>tried setting the Bound to True and binding it to the apmasid and column 2. That is also erratic
>>
>>Seeing the simplicity of the listbox is what I am looking for, isn't this the way to do it? What
>>am I missing (probably obvious 'cept to me). I thought about using a grid (I hate grids) but then
>>I have to program it so that the user can'tchange info in the grid, the current record highlights
>>entirely, etc. and I haven't even gotten into "orders" yet.
>>
>>
>>Thanks for any suggestions.
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform