Hi all,
I have searched both Google and this forum to find the answer to my issue. I am trying to enter data into a table through a Form and then use the data in the form to "Append" another table. I can create the Append Query just fine, but when I try to add the code to a ONCLICK event, I get all kinds of errors. I can't seem to find a similar example to what I am trying to accomplish.
Form "RELENTRY" collects information about a purchase order release. I need some of that data to create another entry on my inventory table to account for the quantity ordered.
This is where I am with my coding:
Private Sub SaveNew_Click()
Dim strSQL As String
strSQL = "INSERT INTO Part Inventory(PARTID, RevLevel, ODID, RELID, RelNum, RQty, INVTRXID, CreatedDate )" _
& "SELECT OrderReleases.PARTID, OrderReleases.RevLevel, OrderReleases.ODID, OrderReleases.RELID, OrderReleases.ReleaseNum, OrderReleases.RelQty, OrderReleases.INVTRXID, OrderReleases.RDateEnt"
FROM OrderReleases
WHERE Me.PARTID = PARTID (Is this where I get only the record from the form to create only 1 record in the Inventory table?)
On Error GoTo SaveNew_Click_Err
On Error Resume Next
DoCmd.GoToRecord , "", acNewRec
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
Command38_Click_Exit:
Exit Sub
Command38_Click_Err:
MsgBox Error$
Resume Command38_Click_Exit
End Sub
Help!
Heidi
I have searched both Google and this forum to find the answer to my issue. I am trying to enter data into a table through a Form and then use the data in the form to "Append" another table. I can create the Append Query just fine, but when I try to add the code to a ONCLICK event, I get all kinds of errors. I can't seem to find a similar example to what I am trying to accomplish.
Form "RELENTRY" collects information about a purchase order release. I need some of that data to create another entry on my inventory table to account for the quantity ordered.
This is where I am with my coding:
Private Sub SaveNew_Click()
Dim strSQL As String
strSQL = "INSERT INTO Part Inventory(PARTID, RevLevel, ODID, RELID, RelNum, RQty, INVTRXID, CreatedDate )" _
& "SELECT OrderReleases.PARTID, OrderReleases.RevLevel, OrderReleases.ODID, OrderReleases.RELID, OrderReleases.ReleaseNum, OrderReleases.RelQty, OrderReleases.INVTRXID, OrderReleases.RDateEnt"
FROM OrderReleases
WHERE Me.PARTID = PARTID (Is this where I get only the record from the form to create only 1 record in the Inventory table?)
On Error GoTo SaveNew_Click_Err
On Error Resume Next
DoCmd.GoToRecord , "", acNewRec
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
Command38_Click_Exit:
Exit Sub
Command38_Click_Err:
MsgBox Error$
Resume Command38_Click_Exit
End Sub
Help!
Heidi