In my database I have a form which is based on query. It displays in tabular format.
I have an extra text box where the user will enter a new value.
Then a button where the values are inserted into a table.
I want the button to add each row of the query into the table with the new value but at the moment can only get it to add the first.
Any ideas how I can do this?
The code on my button currently is shown below Combo15 being the new value and the other values being the results from the query.
If Len(Combo15 & vbNullString) > 0 Then
DoCmd.RunSQL "Insert into BOMs([FG Stk No],[RM Stk No],[Qty per Lot],[I/P WF]) Values (Combo15.Value,[RM Stk No].Value,[Qty per Lot].Value,[I/P WF].Value);"
Else
MsgBox ("You need to add a value")
End If
I will try to explain a little more about why I am doing this.
Table 1 containing RMs with unique 11 digit IDs
Table 2 containing FGS with different unique 11 digit IDs
Table 3 links the RMs to the FGs so each FG will be attached to various different RMs
Sometimes it will be required to copy a group of RMs that are attached to a certain FG
So the query finds all the RMs the user enters the new FG then each of the rows is added to Table 3 linking the new FG and old RMs.
I hope this all makes sence.
Rgds
Hannah