Link to home
Start Free TrialLog in
Avatar of pdvsa
pdvsaFlag for United States of America

asked on

Syntax error - Insert records

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

End sub
ASKER CERTIFIED SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pdvsa

ASKER

Oh i think I have been told that before.  Completely slipped my mind. Thank you