Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TABLEUPDATE(.T.) bombs with uncommitted changes
Message
 
 
To
02/10/2003 05:07:59
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00833421
Message ID:
00834363
Views:
30
Peter,

> every every form's got it's own oToolBar

Since you have a one-to-one relationship between your forms and toolbars, you could explicitly hook them together with bidirectional object refs. Your form already has one to the toolbar, so just add one from the toolbar back to the form:

this.oToolbar = createobject( ..., thisform )

*toolbar.Init( roForm )
this.oForm = roForm

now your toolbar can make callbacks to form methods. One button's click might be:

this.parent.SaveForm()

* toolbar.SaveForm
this.oForm.SaveForm()

* toolbar.Clear
this.oForm = .null. && clear the form pointer

You have to make sure you clear these object references during the form.Destroy:

this.oToolbar.Clear()

But in general this might get you around your _screen.ActiveForm.ActiveControl issues. Because your SaveForm method can generically make sure that the last control has committed its changes to its ControSource.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform