N Nenya Registered User. Local time Today, 15:38 Joined Jul 4, 2003 Messages 20 Jul 17, 2003 #1 I need a way to create new records in a table using code. Anyone can tell me how? Is using ms jet with recordsets the only way? (i don't have it )
I need a way to create new records in a table using code. Anyone can tell me how? Is using ms jet with recordsets the only way? (i don't have it )
S Sdyman Guest Jul 17, 2003 #2 Try this: dim MyDB as Database dim RS as Recordset set MyDB = CurrentDb set RS = MyDB.OpenRecordset("MyTbl") RS.AddNew RS!Field1 = Val1 RS!Field2= Val2 RS.Update RS.close Good luck Greg Last edited: Jul 17, 2003
Try this: dim MyDB as Database dim RS as Recordset set MyDB = CurrentDb set RS = MyDB.OpenRecordset("MyTbl") RS.AddNew RS!Field1 = Val1 RS!Field2= Val2 RS.Update RS.close Good luck Greg
N Nenya Registered User. Local time Today, 15:38 Joined Jul 4, 2003 Messages 20 Jul 17, 2003 #3 Yay! it works! Thx a lot
Mile-O Back once again... Local time Today, 15:38 Joined Dec 10, 2002 Messages 11,305 Jul 17, 2003 #4 Sdyman said: Try this: dim MyDB as Database dim RS as Recordset Click to expand... Just to be safe: Dim MyDB as DAO.Database Dim RS as DAO.Recordset
Sdyman said: Try this: dim MyDB as Database dim RS as Recordset Click to expand... Just to be safe: Dim MyDB as DAO.Database Dim RS as DAO.Recordset