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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Many Radio Buttons Two Tables

Status
Not open for further replies.

Stephenlyn

Programmer
May 25, 2000
34
AU
I have a form with many (150) radio buttons on it linked to a table to indicate yes/no, each time i enter the form I will be clicking 1 or many buttons until they are all yes.&nbsp;&nbsp;Is there a way to and how do I record the 1 or many clicks in another table.<br><br>regards
 
In each of your Radio buttons put this code<br>Private Sub Option10_Click()<br>&nbsp;&nbsp;&nbsp;&nbsp;If Option10.Value = True Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim db As Database, rst As Recordset<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set db = CurrentDb<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set rst = db.OpenRecordset(&quot;SecondTable&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst.AddNew<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst!yourfield = &quot;Option10 Checked&quot;&nbsp;&nbsp;'&lt; change this line to mathch the current Option(radio) buttton.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst.Update<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst.Close<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;db.Close<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>End Sub<br>-----------------------<br>OK<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Thanks DoughP that worked.&nbsp;&nbsp;&nbsp;The code I used is as follows:-<br><br>Private Sub AA1_Click()<br>stLinkCriteria1 = Me![CustomerID]<br>stLinkCriteria2 = Me![PerformanceID]<br>If AA1.Value = True Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim db As Database, rst As Recordset<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set db = CurrentDb<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set rst = db.OpenRecordset(&quot;CustomerSeating&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst.AddNew<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst!CustomerID = stLinkCriteria1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst!PerformanceID = stLinkCriteria2<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst!seat = AA1.Name<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst.Update<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rst.Close<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;db.Close<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;<br><br>End Sub<br><br>I was getting an error at rst.Update however I removed the relationship with another table and the error went away.<br><br>As I have about 770 radio buttons in total on 6 forms thats a lot of copying and pasting and editing... is there a global solution to this that will cut down on the work?<br><br>many thanks<br><br>Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top