Y/N radial option

B

Biba

Hi,

I need to add an IF code in the After Update condition in a Y/N radial
option. But such option is not available. How would I get around the
problem? Which option should I use? Focus set?

TIA

Biba
 
D

Duane Hookom

If the option button is a member of an option group, the individual button
will not have an After Update event. The option group will have an after
update event that you should be able to use.

If your option button is not part of a group, it will have an after update
event.
 
B

Biba

Thank you for replying.
I changed to an option group and added this code:

Private Sub Opt33_AfterUpdate()

If Me.Opt33 = True Then
Me.DATE_IN = Format(Date, "yyyymmdd")
Else
Me.DATE_IN = vbNullString
End If
End Sub

But the compiler halts on DATE_IN and cannot understanding why.
Any help is appreciated.
 
D

Duane Hookom

Changed what to an option group? Is Opt33 your option group? Are there only
two option buttons? What are the Option Values of the buttons in the group?

Is DATE_IN a text box on the form? Do you get an error message?
 
B

Biba

Opt33 is an option radial and is part of an option group. There's only one
option as it's used to write a 1 in field_checked (int) and at the same time
to populate a text field as shown below.
Doing so, marking the opt33 I'm writing into two fields.
 
D

Duane Hookom

If there is only one option button in the group then don't use a group. The
option button in a group will not have a control source value. The option
group will have a value.

If you really want to use an option group, your code should reference the
option group name.
 
Top