I've just inserted a new field into an already existent table, and I would like to populate this field which spans over two thousand records. I would like to create a vba script which will allow me to do this.
I'm assuming that I would have to create a new module but I'm not quite sure how to go about it. I am familiar with attaching simple code to buttons etc, but I'm stumped as to how to do this!
grateful for advice.
- My new field is FileCode, the table name is Files and the vale I want to insert is the letter A -
I have tried the following:
Public Sub insert()
Dim db As Database
Set db = CurrentDb()
CurrentDb.Execute "INSERT INTO Files (FileCode) VALUES ("A")"
DoCmd.RunSQL "INSERT INTO Files ([FileCode]) "VALUES ('A')"