Hi Phil I used the following code
<cfquery name="qArrivalDates" datasource="rayannesql">
SET NOCOUNT ON
INSERT INTO booking (book_made, book_checkin_date,
book_checkout_date, book_adults, book_children)
VALUES('#FORM.book_made#','#FORM.book_checkin_date#','#FORM.book_checkout_date#','#FORM.book_adults#','#FORM.book_children#')
SELECT SCOPE_IDENTITY() AS theNewId;
SET NOCOUNT OFF
</cfquery>
<cfquery name="qArrivalDates" datasource="rayannesql">
INSERT INTO Customer( firstname, lastname, address, address2,
city, state, postalcode, country, phone, mobile, email, notes)
Values (#qArrivalDates.theNewId# '#FORM.firstname#',
'#FORM.lastname#', '#FORM.address#', '#FORM.address2#',
'#FORM.city#', '#FORM.state#', '#FORM.postalcode#',
'#FORM.country#', '#FORM.phone#', '#FORM.mobile#', '#FORM.email#',
'#FORM.notes#' )
</cfquery>
When I tried to complete the form, I got the following error
Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][SQL Native Client][SQL Server]Incorrect syntax
near 'Fred'.
The error occurred in
C:\Inetpub\wwwroot\rayanne\customerinsertsql.cfm: line 16
14 : <cfquery name="qArrivalDates"
datasource="rayannesql">
15 : INSERT INTO Customer( firstname, lastname, address,
address2, city, state, postalcode, country, phone, mobile, email,
notes)
16 : Values (#qArrivalDates.theNewId# '#FORM.firstname#',
'#FORM.lastname#', '#FORM.address#', '#FORM.address2#',
'#FORM.city#', '#FORM.state#', '#FORM.postalcode#',
'#FORM.country#', '#FORM.phone#', '#FORM.mobile#', '#FORM.email#',
'#FORM.notes#' )
17 : </cfquery>