How Do You Insert Record In A Blank Table Of MS ACCESS Through VB6 Give Full Source Code Please?
To insert a record into a table (let’s all it tblX) you must insert at least one field value (plus foreign key values in a related table) The steps are to create an SQL string and then use the DoCmd. For two fields it looks like strSQL = “INSERT INTO tblX (field1, field2) VALUES (value1, value2);” DoCmd.RunSQL strSQL Where value1 is the data to be inserted into field1. String data must be delimited by ‘single quotes’ and dates constants must be delimited by #hash signs#. You can combine the two statements into one, but I generally like the option to put a breakpoint at the DoCmd line to check the SQL, so I keep it at two statements.