Skip to Content
Former Member
Feb 28, 2007 at 08:53 PM

Option Button


Good Afternoon


I have a very basic need that I cannot seem to accomplish after reviewing the samples and help files regarding Option Buttons.

I need 2 options buttons NOT grouped together. They need to toggle on/off independent of eachother. Here is what I have so far:


PREQItem = PREQForm.Items.Add("btnReWork", it_OPTION_BUTTON)

PREQItem.Height = 14

PREQItem.Left = 225

PREQItem.Top = 240

PREQItem.Width = 20

PREQOptBtn2 = PREQItem.Specific

PREQOptBtn2.DataBind.SetBound(True, "", "U_Rework")

PREQOptBtn2.ValOn = "Y"

PREQOptBtn2.ValOff = "N"


PREQItem = PREQForm.Items.Add("btnHot", it_OPTION_BUTTON)

PREQItem.Height = 14

PREQItem.Left = 175

PREQItem.Top = 240

PREQItem.Width = 20

PREQOptBtn = PREQItem.Specific

PREQOptBtn.DataBind.SetBound(True, "", "U_Hot")

PREQOptBtn.ValOn = "Y"

PREQOptBtn.ValOff = "N"

If PREQOptBtn.Selected = False Then

PREQForm.DataSources.UserDataSources.Item("U_HOT").ValueEx = "Y"

PREQOptBtn.Selected = True


PREQForm.DataSources.UserDataSources.Item("U_HOT").ValueEx = "N"

PREQOptBtn.Selected = False

End If

Seems logical but of course it does not work. Simple...If the button is not selected, set Datasource to Y and select button Else the button is selected so set Datasource to N and deselect button.

Can anyone help with how I need ot achieve my results?