Hi all,
(I'm from Holland, so if my English is poor, sorry
)
Is it possible in Access 2000 to create a series of new records (let's say 50) without using the command
DoCmd.GoToRecord , , acNewRec ?
This method works, but it's not very elegant, because the user must wait until Access stops scrolling through the 50 new records in a form.
I think it is possible to use the Recordset object, but when I try this, Access keeps telling me that the types do not match. This is the code I use:
Private Sub butNewClick()
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblNew"
With rst
.AddNew
!naam = "Jan Koehoorn"
.Update
End With
rst.Close
dbs.Close
End Sub
In VBA, this is what I have in [Extra]->[References]
- Visual Basic for Applications
- Microsoft Access 9.0 Object Library
- OLE Automation
- Microsoft ActiveX Data Objects 2.7 Library
- Microsoft DAO 3.6 Object Library
Any help would be much appreciated.
"Dutch"
(I'm from Holland, so if my English is poor, sorry
Is it possible in Access 2000 to create a series of new records (let's say 50) without using the command
DoCmd.GoToRecord , , acNewRec ?
This method works, but it's not very elegant, because the user must wait until Access stops scrolling through the 50 new records in a form.
I think it is possible to use the Recordset object, but when I try this, Access keeps telling me that the types do not match. This is the code I use:
Private Sub butNewClick()
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblNew"
With rst
.AddNew
!naam = "Jan Koehoorn"
.Update
End With
rst.Close
dbs.Close
End Sub
In VBA, this is what I have in [Extra]->[References]
- Visual Basic for Applications
- Microsoft Access 9.0 Object Library
- OLE Automation
- Microsoft ActiveX Data Objects 2.7 Library
- Microsoft DAO 3.6 Object Library
Any help would be much appreciated.
"Dutch"