on click on option group

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an option group that I would like to set the on click property to but
I can't get it to work. I don't know if I'm using the right property. Do I
use this at the option group level or do I put it on the individuals option
properties and if so there's no "on click" property.

What I want is: If an individual clicks on the first option it will put the
[renewal mrc] equal to [ext_price] of that item. Same for the second option.
The third option will make the [renewal mrc] = $0.00. Also, if they go back
and forth on these options I would like it to update it according to the code.

Here is the code:
Private Sub being_renewed_Click()
If [being_renewed] = "1" Then
[renewal mrc] = [ext_price]
If [being_renewed] = "2" Then
[renewal mrc] = [ext_price]
If [being_renewed] = "3" Then
[renewal mrc] = "$0.00"
End If
End If
End If
End Sub

Thanks in advance!
 
Keith said:
I have an option group that I would like to set the on click property
to but
I can't get it to work. I don't know if I'm using the right property.
Do I use this at the option group level or do I put it on the
individuals option properties and if so there's no "on click"
property.

What I want is: If an individual clicks on the first option it will
put the [renewal mrc] equal to [ext_price] of that item. Same for the
second option. The third option will make the [renewal mrc] = $0.00.
Also, if they go back and forth on these options I would like it to
update it according to the code.

Here is the code:
Private Sub being_renewed_Click()
If [being_renewed] = "1" Then
[renewal mrc] = [ext_price]
If [being_renewed] = "2" Then
[renewal mrc] = [ext_price]
If [being_renewed] = "3" Then
[renewal mrc] = "$0.00"
End If
End If
End If
End Sub

Thanks in advance!

Try the AfterUpdate event of the OptionGroup.
 
Okay, It works for the first example but if I click on the second or third
option it doesn't work.
Maybe my code is wrong. Let me check that out. Any other ideas?

Rick Brandt said:
Keith said:
I have an option group that I would like to set the on click property
to but
I can't get it to work. I don't know if I'm using the right property.
Do I use this at the option group level or do I put it on the
individuals option properties and if so there's no "on click"
property.

What I want is: If an individual clicks on the first option it will
put the [renewal mrc] equal to [ext_price] of that item. Same for the
second option. The third option will make the [renewal mrc] = $0.00.
Also, if they go back and forth on these options I would like it to
update it according to the code.

Here is the code:
Private Sub being_renewed_Click()
If [being_renewed] = "1" Then
[renewal mrc] = [ext_price]
If [being_renewed] = "2" Then
[renewal mrc] = [ext_price]
If [being_renewed] = "3" Then
[renewal mrc] = "$0.00"
End If
End If
End If
End Sub

Thanks in advance!

Try the AfterUpdate event of the OptionGroup.
 
Keith said:
Okay, It works for the first example but if I click on the second or
third option it doesn't work.
Maybe my code is wrong. Let me check that out. Any other ideas?

Your If-Then nesting is incorrect and you don't want quotes around a numeric
value. The way you have it now none of the other tests are even performed
unless [renewal mrc] = 1.

Change to...

Select Case Me![being-renewed]
Case 1, 2
[renewal mrc] = [ext_price]
Case 3
[renewal mrc] = 0
End Select
 
Sweet!!!

Thank you so much Rick! You have helped me on so many occasions with your
posts!!!

Rick Brandt said:
Keith said:
Okay, It works for the first example but if I click on the second or
third option it doesn't work.
Maybe my code is wrong. Let me check that out. Any other ideas?

Your If-Then nesting is incorrect and you don't want quotes around a numeric
value. The way you have it now none of the other tests are even performed
unless [renewal mrc] = 1.

Change to...

Select Case Me![being-renewed]
Case 1, 2
[renewal mrc] = [ext_price]
Case 3
[renewal mrc] = 0
End Select
 
Back
Top