PDA

Click to See Complete Forum and Search --> : Inserting Records into a table with VBA (Access)


oioioi
Apr 11th, 2006, 01:53 PM
1. How can you insert records into a table without using SQL in MS Access?

2. How do you know if it is successful or not?

Some sample code would be nice for a noob like me.

Thanks,

salvelinus
Apr 11th, 2006, 04:48 PM
You can import data from another source - text file, Excel, etc
You can enter data manually, via a form or directly into the table.
You can open the table & look for your records.
You can use the query wizard to create a query, which actually uses SQL but does it automatically, you don't have to know any (though you should).

oioioi
Apr 11th, 2006, 05:07 PM
salvelinus,

thanks for your response, but I figured out how to do it with DoCMD.runSQL(), but wanted to know if there was a way to do it in code without writing SQL.

salvelinus
Apr 11th, 2006, 08:14 PM
Yes, that's another way, but still involves SQL, hence the name RunSQL. You're not avoiding SQL that way.