issue with insert query into table

associates

Registered User.
Local time
Today, 10:26
Joined
Jan 5, 2006
Messages
94
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

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
 
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
 

Users who are viewing this thread

Back
Top Bottom