G
Guest
I have a form that loads data into a table. Once the form is updated, I want
to enter the data into another table as well the the form's default table. I
am using the after update event. My code is as follows:
Private Sub Form_AfterUpdate()
'Create a field to hold the sql code'
Dim sqlcode As String
'Build the sql code
sqlcode = "insert into inventory(itemcode, qty, cost, freightin, tax,
receiptdate)" & _
"values [forms]![freceipts]![itemcode]" & _
"[forms]![freceipts]![qty]" & _
"[forms]![freceipts]![cost]" & _
"[forms]![freceipts]![freightin]" & _
"[forms]![freceipts]![tax]" & _
"[forms]![freceipts]![receiptdate]"
'Insert a record
DoCmd.RunSQL sqlcode
End Sub
The sql code is not working and I haven't been able to debug it. I have
been running sql against Oracle, but am new to Access.
-
You do not have to do great things if you do small things with great love.
Mother Theresa
to enter the data into another table as well the the form's default table. I
am using the after update event. My code is as follows:
Private Sub Form_AfterUpdate()
'Create a field to hold the sql code'
Dim sqlcode As String
'Build the sql code
sqlcode = "insert into inventory(itemcode, qty, cost, freightin, tax,
receiptdate)" & _
"values [forms]![freceipts]![itemcode]" & _
"[forms]![freceipts]![qty]" & _
"[forms]![freceipts]![cost]" & _
"[forms]![freceipts]![freightin]" & _
"[forms]![freceipts]![tax]" & _
"[forms]![freceipts]![receiptdate]"
'Insert a record
DoCmd.RunSQL sqlcode
End Sub
The sql code is not working and I haven't been able to debug it. I have
been running sql against Oracle, but am new to Access.
-
You do not have to do great things if you do small things with great love.
Mother Theresa