Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to control WHEN a grid updates?
Message
From
28/03/2000 23:53:44
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00350331
Message ID:
00351885
Views:
24
Barbara...

This works but of course - more questions <grin>....

- Why set the ROWSOURCE to ALIAS instead of FIELDS?
- Does it matter if the BOUND TO is TRUE or FALSE? I can't seem to see any operational differences.
- You said set the CONTROL SOURCE to TALLY.EVENTID... I don't have TALLY in the DE. Only: EVENT,
BAR & VEVENTBAR (the view of the tally file). When I set the CONTROL SOURCE to anything, I get erratic
behavior. The COMBO doesn't sort right, when I pick the records it picks a different record, etc. If I leave it blank
it works EXCEPT (there always has to be one of those)... I can pick the event, pick the bar, and the requery in
the interactive changes displays the records in the view. I can click in the view, no problem. I can also change
the bar, again, no problem. BUT, if I click on the EVENT, I get an error VARIABLE "NAME" IS NOT FOUND.
This is a never ending repeating error. I have to END TASK vfp to get out of it. I tried running the debugger, but
it doesn't show me where this is coming from.

Thanks

>Pete,
>In a combo, the RowSource shows where the data comes from. I'm assuming you want to display the Event.Description, but store the Event.EventID in your Tally table. So you'd set:
>
>RowSourceType = 2 (alias)
>RowSource = Event.Description, EventID NOTE that you only put the table name on the FIRST field, otherwise you'll get an error.
>ColumnCount = 1 This sets the combo to show only the description not the ID value
>ColumnWidths = 100 Set this to show all the data when the combo drops down. The actual number will depend on the field lengths
>BoundColumn = 2 The BoundColumn is the one that will be stored in the Tally table. In this case the EventID
>ControlSource = Tally.EventID. ControlSource is the field where the data will be stored.
>
>Now the Value is the EventID (the second column) but the DisplayValue is the event description, the data the user sees. The controlsource does two things. First it is used to store the combo value into the correct table and field. Second, when you change the tally record it tells the combo which description to display (it gets the EventID from Tally.EventID, checks it against the VALUE column in the combo and brings the Description (DisplayValue) to the screen.
>
>Second: TableUpdate is called whenever you want to save the data. However, VFP will save the data automatically if the table is row buffered and you change the active record. This can be disconcerting! What most of us do is provide Save and Cancel buttons for the user. If they close the form or if they use the VCR buttons (next, back, etc.) there should be a form method that checks to see if the data has been changed and either saves automatically or has the user confirm. (Confirmation messages are a matter of strong opinion both for and against - ask your users and do what they prefer)
>
>Finally, check the GetFldState(-1) function. It will tell you if a record is new, deleted, or if any field has been changed. Obviously if the record has NOT been changed you can ignore the Save/Cancel routines.
>
>HTH
>Barbara
>
>>Barbara....
>>
>>As always, it's jelp like this that make Universal Thread a godsend for novices like me!!!! <grin>
>>
>>I have worked on implementing all you have recommended... do have a question or two...
>>
>>In the last paragraph, you recommend using the VALUE of the combo as opposed to the event.eventid. Your
>>explanation makes alot of sense.... now the question/problem. I assume I set the CONTROL SOURCE to the
>>event.eventid for the combo so the VALUE is set correctly. When I do this, the COMBO acts erratically,
>>selecting different records, displaying different info, etc. I know I am missing something and I am not sure what
>>it is.
>>
>>
>>Second, the TABLEUPDATE() as you refer to needs to be called a) when an event or bar changes (in the
>>interactive change I assume) or when the form is closed. Is there a better way to do this? Is there a flag
>>to know WHEN it needs to be called or just call it automatically?
>>
>>Thanks again for your help and thorough explanations
>>
>>Pete
>>
>>
>
>>>>Barbara....
>>>>
>>>>Hi....
>>>>
>>>>Actually, my nievity (sp) to VFP.... I have in the DE, the cursor for the TALLY table, a filter that reads...
>>>>
>>>>tally.eventid=event.eventid and tally.barnum=bar.number
>>>>
>>>>This seems to work. When the combo's switch the event.eventid or bar.number, the grid updates correctly
>>>>and displays the records, just not at the preferred times.
>>>>
>>>>
>>>>A view has been suggested for me but... a) I have never used one b) when I tried to create one, i got totally
>>>>lost c) when I created one with a ?vp_eventid... parameters, as I RAN the form a box appeared asking me
>>>>for the value for the parameters (not what I want the user to do) d) I wasn't sure HOW to get the view to
>>>>manipulate the tally table correctly as the changes are being made.
>>>>
>>>>
>>>>I stumpled upon the FILTER option in the DE when someone suggested I use a SET FILTER to control the
>>>>table. I am probably being to picky, for it seems to be working, just not 100% to my liking. Here is an example...
>>>>
>>>>- When the form starts, the combos are blank - nothing listed (so is the grid)
>>>>- When the user picks the EVENT (no bar yet), the grid fills. It appears to be filling with data that matches
>>>>the event and the FIRST bar in the list even though it isn't displayed in the combo. I worked around that by
>>>>setting the BAR to the first record and displaying it on the init. It works, not by choice though.
>>>>- When the user picks an EVENT, if that event internal flag says it is ready to be processed, it is to go on and
>>>>continue with the processing. If not, it messageboxs a warning, clears the combo, and sets focus back to the
>>>>combo. Unfortunately, the grid is STILL populated with the old data at this time. Again, not desireable. This
>>>>also happens if the user goes and changes the event a midstream... and the changed to event is an invalid one
>>>>at this time also. The event is blank, but the grid still shows records for a previous event.
>>>>
>>>>Bit confusing for me, REALLY confusing for the user who is by far not computer literate.
>>>>
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