INSERT INTO syntax

  • Thread starter Thread starter owilson
  • Start date Start date
O

owilson

Hi,

I have the following insert statement:

strSQL = "INSERT INTO BillingTable (DivNo, ItemDesc,
Billing Amount, JobNum, YearMonth)" _
& "VALUES (DivNo, ItemDesc, Billing Amount,
JobNum, YearMonth)"

DoCmd.RunSQL strSQL

It works if I take out Billing Amount, but generates
a "Syntax Error" if I include Billing Amount.

Billing Amount is a number, the only one in the statement.

What am I doing wrong?

TIA

Owen
 
hi,
get rid of the space in billing amount. make it
BillingAmount
There are a number of characters you should avoid in
nameing convictions. the space cahracter is one of them.
 
Thanks, but that didn't help. When I print strSQL in the
immediate window, all the values are correct and
BillingAmount doesn't even register...No Null, No "", no
nothin'

Is there something unique about a number field?
 
Hi,

I have the following insert statement:

strSQL = "INSERT INTO BillingTable (DivNo, ItemDesc,
Billing Amount, JobNum, YearMonth)" _
& "VALUES (DivNo, ItemDesc, Billing Amount,
JobNum, YearMonth)"

DoCmd.RunSQL strSQL

It works if I take out Billing Amount, but generates
a "Syntax Error" if I include Billing Amount.

Billing Amount is a number, the only one in the statement.

What am I doing wrong?
what <[email protected]> says is right, but if you
can't avoid the blanks then insert the field into "["
like [Billing Amount]
 
Back
Top