G
Guest
Hi
Can someone please advise how we can do a find for a record so we can amend
rather than going through every one of the records before reaching the one we
are after.
The database we have is very large and at the momnet the code we have in VBA
checks each record one after another until the record we are after is found
but since there is a large volumne of data is there a way to do a find
instead.
below is the code we currently have.
Set db = CurrentDb
Set qy = db.CreateQueryDef("", "SELECT tblRedemptions.* FROM
tblRedemptions WHERE (((tblRedemptions.RedemptionID) Is Null) AND
((tblRedemptions.StoreNo)= " & Me.StoreNo & "));")
Set rs = qy.OpenRecordset
Do Until rs.EOF
rs.Edit
rs.Fields(2) = Me.Combo7
rs.Fields(3) = Date
rs.Fields(5) = RedemptionID
rs.Update
rs.MoveNext
Loop
Thanks
Noemi
Can someone please advise how we can do a find for a record so we can amend
rather than going through every one of the records before reaching the one we
are after.
The database we have is very large and at the momnet the code we have in VBA
checks each record one after another until the record we are after is found
but since there is a large volumne of data is there a way to do a find
instead.
below is the code we currently have.
Set db = CurrentDb
Set qy = db.CreateQueryDef("", "SELECT tblRedemptions.* FROM
tblRedemptions WHERE (((tblRedemptions.RedemptionID) Is Null) AND
((tblRedemptions.StoreNo)= " & Me.StoreNo & "));")
Set rs = qy.OpenRecordset
Do Until rs.EOF
rs.Edit
rs.Fields(2) = Me.Combo7
rs.Fields(3) = Date
rs.Fields(5) = RedemptionID
rs.Update
rs.MoveNext
Loop
Thanks
Noemi