Option group on click update problem

rpadams

Registered User.
Local time
Yesterday, 21:49
Joined
Jun 17, 2001
Messages
111
I have an option group that adds shipping charges after all items are ordered. See below:

Private Sub Frame95_Click()

If Me!Frame95 = 1 Then
Me!txtOrd_Shipping = 0
End If

If Me!Frame95 = 2 Then
Me!txtOrd_Shipping = Me!frmOrderDetailSub!Text19 * 0.1
'rem Text19 = total of items ordered
End If

If Me!Frame95 = 3 Then
Me!txtOrd_Shipping = 0
Me!txtOrd_Shipping.SetFocus
End If

End Sub

The problem arises when option 2 is selected and then Text19 is changed by adding new items. If I re-click option 2, nothing happens but if I select either 1 or 3 and then 2, it recomputes as I want it to. Can I get it recompute if the option doesn't change?
 
You could put code in the After Update event of the control that you change to set the Option Group to 0 so that you must select it after a change is made. (Also delete the value in the field that gets calculated by option 2.) Since option 2 is already selected picking it again does not trigger the code.

hth,
Jack
 
you could also in the after update event of
the textbox insert the code
Frame95_Click

that way the code will run back through the option group click event
without the need to reset the option
 

Users who are viewing this thread

Back
Top Bottom