i'm using the following SQL to INSERT dat from one table to another ( basically confirming an order from a quote ) but keep getting a key violation
Both tables have the same field names, labelled like this:
inventory_quoteBox
------------------
quoteId (autonumber)
quoteId (text)
quoteNumber (number)
inventory_sales
---------------
quoteId (number)
quoteId (text)
quoteNumber (number)
Here's my SQL called from my button
Private Sub cmdConfirmQuote_Click()
On Error GoTo Err_cmdConfirmQuote_Click
DoCmd.RunSQL "INSERT INTO inventory_sales (clientId, quoteNumber) VALUES ([inventory_quoteBox]![clientId],[inventory_quoteBox]![quoteNumber])"
Exit_cmdConfirmQuote_Click:
Exit Sub
Err_cmdConfirmQuote_Click:
MsgBox Err.description
Resume Exit_cmdConfirmQuote_Click
End Sub
can anyone help me on this - i'm pulling my hair out
Both tables have the same field names, labelled like this:
inventory_quoteBox
------------------
quoteId (autonumber)
quoteId (text)
quoteNumber (number)
inventory_sales
---------------
quoteId (number)
quoteId (text)
quoteNumber (number)
Here's my SQL called from my button
Private Sub cmdConfirmQuote_Click()
On Error GoTo Err_cmdConfirmQuote_Click
DoCmd.RunSQL "INSERT INTO inventory_sales (clientId, quoteNumber) VALUES ([inventory_quoteBox]![clientId],[inventory_quoteBox]![quoteNumber])"
Exit_cmdConfirmQuote_Click:
Exit Sub
Err_cmdConfirmQuote_Click:
MsgBox Err.description
Resume Exit_cmdConfirmQuote_Click
End Sub
can anyone help me on this - i'm pulling my hair out