I hope I can explain what I'm doing here.
1. I've created a form in which users enter production as well as scrap pieces.
2. If they have scrap I create a table using their clock number (I.D.#) for the name.
3. I then send that information to a list box so they can examine what they are putting in to the list.
4. When they are done the user will push a button and all the production information gets sent to one table (via SQL) and the scrap information needs to go to the Scrap table.
5. I then delete the clock number table and all should be done.
Appending mulitple records to the Scrap table is what I'm having a hard time doing or understanding.
Here is the code for what I have. tbltempscrap is the table I'm trying to Append the records to from my clocknumber table.
Private Sub cbaddreport_Click()
Dim strclocknumber As String, strSQL As String
strclocknumber = Me.tbclocknumber.Value
Me.lbstuff.RowSource = ""
strSQL = "INSERT INTO tbltempscrap ([Clock number,Partnumber,Operation,Rate " _
& " SELECT " & strclocknumber & "[Clock number],Partnumber,Operation,Rate" _
& " FROM tbltempscrap;"
DoCmd.RunSQL strSQL
DoCmd.DeleteObject acTable, strclocknumber
End Sub
Need more info just post back please.
There is probably a better way of doing what I'm trying to do and maybe that would be my answer.
Rib
Bartender:Hey aren't you that rope I threw out an hour ago?
Rope:No, I'm afraid knot.
1. I've created a form in which users enter production as well as scrap pieces.
2. If they have scrap I create a table using their clock number (I.D.#) for the name.
3. I then send that information to a list box so they can examine what they are putting in to the list.
4. When they are done the user will push a button and all the production information gets sent to one table (via SQL) and the scrap information needs to go to the Scrap table.
5. I then delete the clock number table and all should be done.
Appending mulitple records to the Scrap table is what I'm having a hard time doing or understanding.
Here is the code for what I have. tbltempscrap is the table I'm trying to Append the records to from my clocknumber table.
Private Sub cbaddreport_Click()
Dim strclocknumber As String, strSQL As String
strclocknumber = Me.tbclocknumber.Value
Me.lbstuff.RowSource = ""
strSQL = "INSERT INTO tbltempscrap ([Clock number,Partnumber,Operation,Rate " _
& " SELECT " & strclocknumber & "[Clock number],Partnumber,Operation,Rate" _
& " FROM tbltempscrap;"
DoCmd.RunSQL strSQL
DoCmd.DeleteObject acTable, strclocknumber
End Sub
Need more info just post back please.
There is probably a better way of doing what I'm trying to do and maybe that would be my answer.
Rib
Bartender:Hey aren't you that rope I threw out an hour ago?
Rope:No, I'm afraid knot.