Normal Topic [Solved] FormDependentValue (Read 952 times)
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
[Solved] FormDependentValue
Jan 24th, 2008 at 4:57pm
Print Post Print Post  
Is there a way to deactivate FormDependentValue once it has been activated?

Once it is activated, it stays active until I exit the form. But, I wanted to have it active or deactive based on the value in a "Category" field.
« Last Edit: Jan 29th, 2008 at 4:03am by Hammer »  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: FormDependentValue
Reply #1 - Jan 24th, 2008 at 5:31pm
Print Post Print Post  
I'm going to have to look at the source code to answer this one, Carl. FormDependentValue was not designed to be conditional. I'll let you know if I see any way to remove it once it's been set.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FormDependentValue
Reply #2 - Jan 24th, 2008 at 6:02pm
Print Post Print Post  
Hammer wrote on Jan 24th, 2008 at 5:31pm:
FormDependentValue was not designed to be conditional.
I know. But you know me, I like to force Sesame in directions you never intended. Smiley

Actually, I'm currently getting along pretty well using XResultSet commands and loops to do what I want, with one exception. When I delete a subform record, the parent value doesn't update (unless I click on a command button I created for this issue). FormDependentValue takes care of that for me. But I only want to place the sum of the values in the subrecords, on the parent if the Category is a particular value. Otherwise, I want the parent form's value placed in the subform (that's the reason I wanted to deactivate FormDependentValue for some records).

I seem to remember that there was a command that would let SBasic know that a subform record was just deleted, but I can find it in the programming guide (probably, because I'm not searching on the correct name). Am I imagining things, or does such a command exist?
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: FormDependentValue
Reply #3 - Jan 24th, 2008 at 6:07pm
Print Post Print Post  
Quote:
Actually, I'm currently getting along pretty well using XResultSet commands and loops to do what I want, with one exception. When I delete a subform record, the parent value doesn't update (unless I click on a command button I created for this issue). FormDependentValue takes care of that for me. But I only want to place the sum of the values in the subrecords, on the parent if the Category is a particular value. Otherwise, I want the parent form's value placed in the subform (that's the reason I wanted to deactivate FormDependentValue for some records).

Sounds confusing...  Smiley  What if you have a field that always receives the result of FormDependentValue, and you set a different field conditionally if the Category meets your requirements?


Quote:
I seem to remember that there was a command that would let SBasic know that a subform record was just deleted, but I can find it in the programming guide (probably, because I'm not searching on the correct name). Am I imagining things, or does such a command exist?

There's an On Form Delete event to which you can respond.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FormDependentValue
Reply #4 - Jan 24th, 2008 at 6:13pm
Print Post Print Post  
Hammer wrote on Jan 24th, 2008 at 6:07pm:
Sounds confusing...  Smiley  What if you have a field that always receives the result of FormDependentValue, and you set a different field conditionally if the Category meets your requirements?

Good idea.

Quote:
There's an On Form Delete event to which you can respond.

That's it! No wonder I couldn't find the command, it's not a command, it's an event.

Thank you very much. Smiley
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FormDependentValue
Reply #5 - Jan 29th, 2008 at 3:33am
Print Post Print Post  
Hammer wrote on Jan 24th, 2008 at 5:31pm:
I'm going to have to look at the source code to answer this one, Carl. FormDependentValue was not designed to be conditional. I'll let you know if I see any way to remove it once it's been set.

Erika,

You can probably consider this one solved. I have figured out how to make FormDependentValue conditional.

The answer is so simple. All I need to do, is add an unbound, hidden, LE to the main form, and use it as the target of FormDependentValue. Then I can copy its value to the regular, bound, LE when the conditions require it.

I hope you didn't waste any time on this yet. Sorry, and thanks for all your help.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: FormDependentValue
Reply #6 - Jan 29th, 2008 at 4:02am
Print Post Print Post  
Quote:
I hope you didn't waste any time on this yet. Sorry, and thanks for all your help.

Your issues are never a waste of time, Carl. I'm glad you found a way to do what you wanted and took the time to share it with the rest of us.  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged