View Full Version : issue with insert query into table


associates
11-07-2007, 10:36 PM
Hi,

I wonder if i could get some help here with the SQL insert into table. I got Syntax Error when executing the following code

strSQL = "INSERT INTO [Time Sheet] (SFirstName, SLastName, Department_No, Status, subject_taken)"
strSQL = strSQL & " VALUES ('Mike','Fraser','01','FullTime',3)"

WorkBase.Execute strSQL, dbFailOnError
WorkBase.Close

Time Sheet table:
SFirstName - type(text)
SLastName - type(text)
Department_No - type(text)
Status - type(text)
subject_taken - type(number)

Everytime i remove the subject_taken field and 3 from the insert query, it works nicely.

The field size of the subject_taken is double
Decimal places = auto
default value = 0
required = no
indexed = no

Is there a proper syntax for inserting data field of type double?

Thank you in advance

burrcm
11-08-2007, 03:11 AM
This works fine -

DoCmd.RunSQL "INSERT INTO [Time Sheet] (SFirstName, SLastName, Department_No, Status, subject_taken) VALUES ('Mike','Fraser','01','FullTime',3);", -1

Examine the differences.

Chris B