Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order Data in COMBOS?
Message
From
15/07/1999 18:28:53
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
 
To
15/07/1999 10:39:44
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00241112
Message ID:
00242052
Views:
17
Nancy,

Maybe I'm confused... the combos are exactly as you say on page1 or my pageframe. Page1 is used for add/edit/delete, etc. Page2 has a grid that is stricktly used like a listbox and just displays the data that the combos added to the table in textbox format. The table stores the data as the ID # I assigned from the OTHER tables.

Without the relations, the combos work and sort fine thanks to the ORDER in the DE for the cursor related to the combo. The problem becomes the grid.. I get something like this.

DATE EMPLOYEE CLIENT CODE AMOUNT
07/10/99 Brama, Peter ABC Company 111-test 45.00
07/11/99 Brama, Peter ABC Company 111-test 30.00
07/12/99 Brama, Peter ABC Company 111-test 15.00


it should read....
07/10/99 Brama, Peter ABC Company 111-test 45.00
07/11/99 Smith, John DEF Business 211-test2 30.00
07/12/99 Brama, Peter QTY Enterp. 321-test3 15.00


It appears that the 3 textfields (EMP, CLIENT, CODE) are repeating from the first record down. I would assume this is because the appropriate files never change thanks to the lost relationship.

Pete





>Actually, it will work. What you are trying to do is not uncommon. < s> Well, you don't specify what task your combos are intended to fulfill. But, I'm assuming you are using them to give users a set of allowed options for filling in a table's field. So, for example, a combo might be filled from a look up table of states for filling in the state field in a customer's table. Or, you could have combo that is populated by employee's names so the user can pick one employee for filling in the log table's employee field.
>
>First, you need to refresh pages when you activate them. Easiest thing to do is put a this.refresh() in the page activate() method.
>
>Second of all, keep combo rowsources out of relations. The cleanest way I've found is to do the following (rough idea):
>
>1. columncount = 2
>2. columnwidths = 200,0
>3. controlsource = a table field, or unbound.
>4. rowsourcetype = 3
>5. rowsource = SELECT TRIM(employee.lastname)+", "+employee.firstname AS cName FROM employee INTO CURSOR vwEmployeeName ORDER BY 1
>
>If you use an unbound combo, then you will want to replace whatever fields in the interactivechange, valid, or lostfocus. Which one depends a bit.
>
>One of the best things to understand in combos is that they work better (IMO) if they are populated from a cursor separate from the cursor that is being updated. That sentance leaves a lot to the imagination, I know, but this is a pretty deep topic.
>
>I'd recommend one of my personal favorite books: Effective Techniques for Application Development with Visual FoxPro 6.0. It's good even if you are using 5.0.
>
>HTH
>
>>Nancy,
>>
>>Unfortuntely this won't work. I have a main table called LOG that links to 3 other tables EMP, CLIENT, CODE to get a few fields of information. When I blow out the relationships, the entry form page with combos, works fine and they are alphabetized, yeah!! When I flip to page2 the grid, all the column textboxes that hold the info from the other files list the same right down the column even though its different.
>>
>>The textboxes use control sources like:
>> TRIM(employee.lastname)+", "+employee.firstname
>>
>>I thought about using a view (never tried one) but was prompted in the view wiz that it wouldn't work because I can't have the SAME main table (LOG).
>>
>>Any other suggestions for the grid without losing the "link" feature for flipping back and forth for editing purposes between the two page frames.
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