Syntax error - Insert records
Posted on 2016-08-23
Experts, I keep getting a syntax on the insert line. Do you see where I have made a mistake? It might be something to do with the # placement on the date field. the VBA is on a button on the parent and the records I am inserting are on a subform.
Private Sub cmdInsertRecords_Click()
Dim db As DAO.Database, intMyValue As Date, intMyValue2 As Integer
intMyValue = Me.DrawDate
intMyValue2 = Me.Currency
Set db = CurrentDb
db.Execute "Insert into tblDraws_Details1 (ValueDate, Currency) VALUES (#" & intMyValue & "#," & intMyValue2 & ")"
Set db = Nothing