Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RadioButton Data Binding Problem

Status
Not open for further replies.

swk003

IS-IT--Management
Feb 10, 2004
86
GB
I am having trouble binding radio buttons(have also tried checklistbox's and checkbox's)to an Access table. All the textbox controls on my data input form work fine and insert the data to the table, however the radio button checks do not pass to the table. I have bound the data using the data adaptor and dataset Wizard's. Also I have tried all of the databinding properties of the dataset but no luck! I would be grateful for any help. Thanks

 
and what are you trying to achieve? one value for multiple radiobuttons?

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Hi Chrissie

I intend to do simple data binding by passing 1 value 'yes'(checked) or 'no'(unchecked)from individual radiobuttons to individual yes and no fields in the Access table. The Access table has the boolean format yes/no set for each field!!!

Is this possible without doing any coding?

thanks

swk003
 
I have tried the following checkbox data binding code and I still get no data insertion in the table, can anyone help with this?

Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged


CheckBox2.DataBindings.Add("Checked", dsLogging.PinkGradingLoggingData, "EyeRight")
End Sub
 
Problem solved. I set the default value for the radio buttons and checkboxes at loadtime. As follows:

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load


dsLogging.PinkGradingLoggingData.Columns.Item("EyeRight").DefaultValue() = CBool("true")// or false"

And then added the databindings code to the radiobox grp event code, as follows:

rdoEyeRight.DataBindings.Add(New Binding("Checked", dsLogging, "PinkGradingLoggingData.EyeRight"))

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top