Insert automaticaly records

inbal

Registered User.
Local time
Today, 12:00
Joined
Feb 8, 2009
Messages
48
Hi good people,

I am trying to add automaticaly records to my data base, but I got error code 3134, I think it because the date and time fields

my code is:

Strsql = "INSERT INTO activityclosed ( teachers,project, cost,activity,subject,room,lab,notes,phisics,storage,date,from time, class) "
Strsql = Strsql & "VALUES('" & "dror" & "', '" 'VALUES
Strsql = Strsql & "mada" & "',"
Strsql = Strsql & 77 & ",'"
Strsql = Strsql & "activity" & "','"
Strsql = Strsql & "subject" & "','"
'Strsql = Strsql & 12 & ","""
Strsql = Strsql & "room" & "','"
Strsql = Strsql & "lab" & "','"
Strsql = Strsql & "notes" & "','"
Strsql = Strsql & "phisics" & "','"
Strsql = Strsql & "storage" & "',#"
Strsql = Strsql & "04/04/2009" & "#,#" 'CDate
Strsql = Strsql & "11:15" & "#,'" 'CDate
Strsql = Strsql & "h6" & "');"
MsgBox Strsql
DoCmd.RunSQL Strsql

Thanks,
Inbal
 
Apparently executed the statement looks like this:
Code:
INSERT INTO activityclosed ( teachers,project, cost,activity,subject,room,lab,notes,phisics,stora ge,date,from time, class) VALUES('dror', 'mada',77,'activity','subject','room','lab','notes','phisics','storage',#04/04/2009#,#11:15#,'h6');
So remove the space between stora and ge and try again.

HTH:D
 
Hi Guus2005,

This was just a copy paste error from access to the forum, so if you have more ideas...

Thanks, Inbal
 

Users who are viewing this thread

Back
Top Bottom