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!

Check Box determines if Insert is made to Intersection Table

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Here is the issue:

A form will be displayed with 50+ checkboxes of different colors (i.e. red, blue, yellow, green) and 20+ checkboxes of different paint brushes. There are three tables: One Parent table "Paintings" and two intersection tables, ColorsUsed and PaintBrushesUsed. There is also a Color table and a TypeOfBrushes table. Anyhow, on the form with all of the check boxes, the user will Check the boxes that apply to that painting, say, Red, White, Blue and the different type of paint brushes used. When the user is done check all that apply, they click a Save button and the values for the checkboxes will be added to the intersection table, along with the "painting" key. What code will make this to happen?
 
Dim Rs1 As ADODB.Recordset
Dim SQLCode As String
Set Rs1 = New ADODB.Recordset
' you need a loop or something
SQLCode = "INSERT INTO [intersection table] ( Id, color, paintKey ) SELECT " & RecordID & " AS Expr1, " & Me!Check.name & " AS Expr2, " & PaintKey & " AS Expr3;"
' and I'm not sure if you are calling the Check boxes the color name or what
Rs1.Open SQLCode, CurrentProject.Connection
Set Rs1 = Nothing
Set Conn2 = Nothing
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top