end of statement...why??

  • Thread starter Thread starter AngiW
  • Start date Start date
A

AngiW

Why am I getting Compile Error Expected: End of statement on this? It
highlights the first [Accrual main].

docmd.RunSQL Update [Accrual Main] Set [Accrual Main].SickAvail =
[Accrual Main]![SickAvail] + 5;


also, this is going in my startup macro...do i need to put table![accrual main]
in there instead?

tia
 
You must enclose the SQL statement inside " characters and you use a . not a
! between the table name and the field name.

DoCmd.RunSQL "Update [Accrual Main] Set [Accrual Main].SickAvail = [Accrual
Main].[SickAvail] + 5;"
 
You need to pass the SQL to the RunSQL command as a string.

docmd.RunSQL "Update [Accrual Main] Set [Accrual Main].SickAvail = [Accrual
Main]![SickAvail] + 5;"
 
You need to pass the SQL to the RunSQL command as a string.

docmd.RunSQL "Update [Accrual Main] Set [Accrual Main].SickAvail =
[Accrual Main]![SickAvail] + 5;"

And of course, you get much more control using

db.Execute "UPDATE [..."

B Wishes


Tim F
 
Back
Top