radio button question

  • Thread starter Thread starter peashoe
  • Start date Start date
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
 
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.
 
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
 
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!
 
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Radio Buttons 3
Group Option value (radio) 2
Radio Button as Filter 2
Radio Button Macro 3
Radio button enables Combo Box 3
Radio Button output 3
Check Box Question 3
Radio Buttons in Subforms 2

Back
Top