radio button question

P

peashoe

I have an option group with radio buttons Yes/No with a textbox next to
Yes
I need to add a Before Update event to say:

if txtbox <> "" then
YES
end if

the problem is - yes = chkYes and no=chkNo within the group. How do I
assign it to yes automatically if they enter something in the textbox?

Thanks in advance
Lisa
 
J

Jeff L

In an option group, each option is given a numeric value. In your case
Yes is 1 and No is 2, more than likely. To set the option group to yes
the syntax would be

Me.OptionGroupName = iif(IsNull(Me.txtbox), 2, 1). This checks to see
if the value of txtbox is null and if it isn't give the option group a
value of one.
 
J

Jeff L

I have an option group with radio buttons Yes/No with a textbox next to
Yes
I need to add a Before Update event to say:

if txtbox <> "" then
YES
end if

the problem is - yes = chkYes and no=chkNo within the group. How do I
assign it to yes automatically if they enter something in the textbox?

Thanks in advance
Lisa
 
J

Jeff L

In an option group, each option is given a numeric value. In your
case, Yes is probably 1 and No is probably 2. To set the option group
to yes, your syntax would be

Me.OptionGroupName = Nz(Me.txtbox, 1)

Hope that helps!
 
J

Jeff L

In an option group, each option is given a numeric value. In your
case, Yes is probably 1 and No is probably 2. To set the option group
to yes, your syntax would be

Me.OptionGroupName = Nz(Me.txtbox, 1)

Hope that helps!
 
Top