|
Runtime Error with Insert
I am having trouble getting the information on my form to be inserted into a table. Here is what I have:
Private Sub Command18_Click()
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb
MyQuery = "Insert into tblREVISIONS (UserName, TypeofModification, DrawingNumber, Date) Values (" & UserName.Value & ", " & TypeofModification.Value & ", " & DrawingNumber.Value & ", '" & Date & "')"
DoCmd.RunSQL MyQuery
End Sub
When I try to run this I receive a Run-time error 3134 Syntax error in INSERT INTO statement and when I click Debug it highlights the DoCmd.RunSQL MyQuery
Any Help would be much appreciated. Thank You in advance.
|