Microsoft Access - AddRecord

Sample - Add a record to a table in the database.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'
' update the lease assistance history
'
dim rs as adodb.recordset
set rs = new adodb.recordset
rs.open "test", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs.AddNew
rs!Code=cboOrgCode.value
rs!Per_Count = txtPerCount.value
rs!Name=txtName.value
rs!When = now
rs!What = "D"
rs.Cutput
rs.Close
set rs=nothing