Guy Rondeau
08-16-2000, 11:50 AM
Greetings:
I'm using Access97. I use text boxes on a form to display the records and data. I would like to add a button and use it's click event to add new records and data for those records. I was trying to use a loop something like this:
Private Sub AddNewRecords Click()
Option Compare DataBase
Option Explicit
Dim Count As Number
Dim Var1 As Number
Count = 0
'Each record has a number field called tag, get last tag number used
???Move to last record???
Var1 = Me.tag
'Add new records and data to the fields
Do until count = 150
???Add New Record???
Me.tag = Var1 + 1
Me.this = something
Me.that = something
Me.lots more fields = something etc
Var1 = me.tag
Count = Count + 1
Loop
End Sub
I don't know what code is needed to "Move to the Last Record" and "Add New Record". In help it talks about establishing record sets and updating but I don't know what this means or how it is done. Your help is appreciated.
Thanks
I'm using Access97. I use text boxes on a form to display the records and data. I would like to add a button and use it's click event to add new records and data for those records. I was trying to use a loop something like this:
Private Sub AddNewRecords Click()
Option Compare DataBase
Option Explicit
Dim Count As Number
Dim Var1 As Number
Count = 0
'Each record has a number field called tag, get last tag number used
???Move to last record???
Var1 = Me.tag
'Add new records and data to the fields
Do until count = 150
???Add New Record???
Me.tag = Var1 + 1
Me.this = something
Me.that = something
Me.lots more fields = something etc
Var1 = me.tag
Count = Count + 1
Loop
End Sub
I don't know what code is needed to "Move to the Last Record" and "Add New Record". In help it talks about establishing record sets and updating but I don't know what this means or how it is done. Your help is appreciated.
Thanks