Hi
I keep getting an error "Compile error. Expected: End of Statement" when using the following within VBA?
DoCmd.RunSQL UPDATE [tblBACS Charge File report] SET [tblBACS Charge File report].Field4 = "0"+[Field4] WHERE ((Len([Field4])<"4"));
I am trying to update a table where a text field [Field4] is only 3 characters long and should be 4 characters with a leading zero ["0"]? e.g. "106" should be "0106".
The above SQL was created [by the system] from an update query that works perfectly as native and also if run as SQL within a macro. It will just not run in VBA?
I am a bit of a novice so any help would be most welcome.
NB Am using Access2010.
Thanks
David
I keep getting an error "Compile error. Expected: End of Statement" when using the following within VBA?
DoCmd.RunSQL UPDATE [tblBACS Charge File report] SET [tblBACS Charge File report].Field4 = "0"+[Field4] WHERE ((Len([Field4])<"4"));
I am trying to update a table where a text field [Field4] is only 3 characters long and should be 4 characters with a leading zero ["0"]? e.g. "106" should be "0106".
The above SQL was created [by the system] from an update query that works perfectly as native and also if run as SQL within a macro. It will just not run in VBA?
I am a bit of a novice so any help would be most welcome.
NB Am using Access2010.
Thanks
David