record won't insert

S

Skeniver

Hi there

I have a line of SQL that inserts a record to a table. It runs fine
sometimes and doesn't run sometimes. I can't figure out any reason why...?

Here is a line that runs and inserts with no problems:
"insert into tblTrans (AccNo, TDate, Ref, Amount, Bal, CatID, Split, Income)
values ('10821468, #24/06/2008#, 'LLOYDS', 17.5, 17.5, 71, False, True)"

and here is one that doesn't:
"insert into tblTrans (AccNo, TDate, Ref, Amount, Bal, CatID, Split, Income)
values ('10821468', #01/07/2008#, 'ODEON CINEMAS', 14.6, 2.9, 52, False,
False)"

They are generated by the exacted same code into a string and then run with
DoCmd.RunSQL SQL. Neither fails, but only one inserts the record...?

Any ideas anyone?

Thanks in advance
 
K

Ken Warthen

The account number in the first example is missing a closing quote mark. Is
that a typo on your part?

Ken
 
S

Skeniver

Hi Ken

I just noticed that... Yes it is. I rewrote the 'working' line and copied &
pasted the 'broken' one.

Sorry...
 

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

Top