compile error on SQL

  • Thread starter Thread starter Brian
  • Start date Start date
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
 
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
 
Back
Top