SQL Insert Into

IanT

Registered User.
Local time
Today, 09:31
Joined
Nov 30, 2001
Messages
191
Hi
I am using this code to append data to a table, the code appends once ok then if you try again there is a error saying it cannot append any records. Can anyone help!

Dim db As DAO.Database
Dim SQL As String

Dim strActivityType As String
Dim strNow As String
Dim strProdCode As String

Set db = CurrentDb

strActivityType = Forms!frmProducttree.txtType
strNow = Forms!frmProducttree.txtNow
strProdCode = Forms!frmProducttree.sfmGeneric.Form.[Product reference]

SQL = "INSERT INTO tblSale ( QuoteRef, BusinessType, ProductCode )" & _
"SELECT '" & strNow & "','" & strActivityType & "','" & strProdCode & "'"

DoCmd.RunSQL SQL
 

Users who are viewing this thread

Back
Top Bottom