SQL Insert

B

Brian C

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
 
L

Lynn Trapp

For one, and this may just be a typo, but you are missing the word INTO from
your basic statement. The syntax for an insert statement is:

INSERT INTO TableName([Field1],[Field2],...)
VALUES(Value1,Value2,...);

Use the function Date() to insert the current date or Now() to insert the
date AND time.
 

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


Top