Good Evening:
I have been in non-VBA mode for the past year, and cannot seem to see thing that are probably obvious to others. I am getting a Runtime 3078 (cannot find the input table or query "INSERT INTO...") Below is the sub. I would really appreciate it if someone could lend a second pair of eyes. I have double checked that table and field names are correct.
Code:
Private Sub cmdLogVol_Click()
Dim strInsertSQL, strQuerySQL As String
Dim dteVolDate As Date
Dim db As DAO.Database
Dim rsInsert As Recordset
dteVolDate = Format(Date, "Short Date")
Set db = CurrentDb
strQuerySQL = "SELECT Company, SKU, InvVolume FROM Inventory WHERE Company = 'Contract - Company1' OR Company = 'Contract - Company2';"
Set rsInsert = db.OpenRecordset(strQuerySQL)
strInsertSQL = "'INSERT INTO InvVolData (Company, SKU, InvVolume, VolDate) VALUES (' & rs!Company & ',' & rs!SKU & ',' & rs!InvVolume & ',' & dteVolDate & ';'"
db.Execute strInsertSQL, dbFailOnError
End Sub
Thanks in advance for any insight.