I want to test a record set to make sure it is at the new record and then copy several sets from another table, this is how far I am, mydata1 will be the number of records to copy and mydata2 will be the start of the transfer.
The bits that are commented out are the bits I have the problem with, the "rec1 = Nothing" wont work and do I have to dim things as DAO.
Dim db As Database
Dim rec1 As Variant
Dim rec2 As Variant
Dim myData1 As Integer
Dim myData2 As Integer
Set db = CurrentDb()
Set rec1 = db.OpenRecordset("Table1"
rec1.MoveFirst
myData1 = rec1(0)
rec1.MoveNext
myData2 = rec1(0)
Set rec2 = db.OpenRecordset("Table2"
rec2.MoveLast
'If rec2 = NewRecord Then
'MsgBox "OK to move data"
'Else
'MsgBox "Not at new record"
'End If
rec1.Close
rec2.Close
'rec1 = Nothing
The bits that are commented out are the bits I have the problem with, the "rec1 = Nothing" wont work and do I have to dim things as DAO.
Dim db As Database
Dim rec1 As Variant
Dim rec2 As Variant
Dim myData1 As Integer
Dim myData2 As Integer
Set db = CurrentDb()
Set rec1 = db.OpenRecordset("Table1"
rec1.MoveFirst
myData1 = rec1(0)
rec1.MoveNext
myData2 = rec1(0)
Set rec2 = db.OpenRecordset("Table2"
rec2.MoveLast
'If rec2 = NewRecord Then
'MsgBox "OK to move data"
'Else
'MsgBox "Not at new record"
'End If
rec1.Close
rec2.Close
'rec1 = Nothing