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

Option Button

66 Views

Good Afternoon

Experts:

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:

'Rework

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"

'Hot

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

Else

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?

Thanks,

EJD