compile error on SQL

B

Brian

I am tring to insert some data from a form to a table:

INSERT BOOKING([Blocked Booked], [Teacher's Initials],
[Booking Date])
VALUES(forms![SINGLE BOOKING DETAIL]![Blocked Booked],
forms![SINGLE BOOKING DETAIL]![Teacher's Initials],
[Current Date])

but get a compile error expecting: =.

Have I got the wrong format for inserting a record, or is
there another syntax problem?

I want to insert the current date in the last field. Is
there something I put instaed of current date?

The primary key of Booking is [Booking ID]with a Data Type
of AutoNumber

Thanks guys
 
M

MacDermott

The usual syntax for Insert starts with
INSERT INTO [TableName]...
In your case, it looks as if INTO is missing.

You haven't said how you're using this SQL statement in code;
you'll need something like
DoCmd.RunSQL , or
CurrentDB.Execute,
either one followed by a string representing the SQL statement.

How you're executing the statement will influence how you build it.

HTH
- Turtle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQL Insert 1
Insert a record in a table 2
Runtime error 438 1
Access ID 3
Learning SQL .... Help Please 3
function like vlookup in infopath 0
getting lastModified in access2007 1
Events template - Access 2007 0

Top