NigelShaw
Registered User.
- Local time
- Today, 08:52
- Joined
- Jan 11, 2008
- Messages
- 1,575
Hi All,
what would be better, a new record using Recordset code or code with SQL? currently, i am entering data like-
Dim db As DAO.Database
Dim rs As DAO.Recordset
set db = Currentdb
set rs = db.Openrecordset("MyTable/Query", dbopendynaset)
rs.Addnew
rs!Field1 = MyEnteredData1 ' add text string
rs!Field2 = MyEnteredData2 ' add boolean value to True
rs.update
rs.Close
db.Close
set rs = Nothing
set db = Nothing
im pretty sure there is an easier way of entering data into a table as a new record. im not entirely sure how as im not great with SQL but could the above be done without using the above?
i thought that going down the SQL route, you could also update a record rather than adding new records.
im looking up sql at the minute but how would i do the above in sql rather than my example?
many thanks,
Nigel
what would be better, a new record using Recordset code or code with SQL? currently, i am entering data like-
Dim db As DAO.Database
Dim rs As DAO.Recordset
set db = Currentdb
set rs = db.Openrecordset("MyTable/Query", dbopendynaset)
rs.Addnew
rs!Field1 = MyEnteredData1 ' add text string
rs!Field2 = MyEnteredData2 ' add boolean value to True
rs.update
rs.Close
db.Close
set rs = Nothing
set db = Nothing
im pretty sure there is an easier way of entering data into a table as a new record. im not entirely sure how as im not great with SQL but could the above be done without using the above?
i thought that going down the SQL route, you could also update a record rather than adding new records.
im looking up sql at the minute but how would i do the above in sql rather than my example?
many thanks,
Nigel