Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Partial Revert

Status
Not open for further replies.

Dazb75

Programmer
Aug 14, 2002
10
GB
I have a form which has a checkbox to only enable certain controls on the form. Is there a way to revert these controls without reverting any other changes on the form (within other containers). I tried the following code, but no joy.

this.Parent.container1.SetAll("Enabled", .F.)

Any ideas?
 
When you say revert, do you mean revert the changes to the data or switch them back to disabled?
If you mean switch them back to disabled, you could just use the same control you use to enable them. Rather than just have that checkbox set them to enabled, change the code in the click event to toggle the state:
Code:
*... checkbox click event
Thisform.SomeControl.enabled = [COLOR=blue]![/color]Thisform.SomeControl.enabled 
Thisform.AnotherControl.enabled = [COLOR=blue]![/color]Thisform.AnotherControl.enabled

If you're talking about reverting a transaction on partial data, you can't, unless it is from different data sources and you have started a transaction for each.
You'll have to do something like SCATTER to save the values to variables and restore them if needed.

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
I achieve something similar to what you are trying to do with a textbox class. It may not be the best way of doing it but it seems to work for me.

in the keypress event of the textbox I have something like this:

IF nKeyCode = 13 Then
lcSelection = This.Value
lcField = this.controlsource
lcTable = ALIAS()
lcRevert = OLDVAL(lcField, lcTable)

DO CASE lcSelection
CASE lcSelection = "//"
IF NOT ISBLANK(lcRevert) Then
This.Value = lcRevert
ELSE
This.Value = ""
ENDIF
ENDCASE
ENDIF

Now when the user types '//' into the textbox, it goes back to it's original value.

Hope this helps.

-Kevin



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top