Recordset Compare DATA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

GRUUUU,,

In the record of each when to go back to the previous record to compare with
the current record suppose we use the code :

prerecord = currentrec
rsst.movenext
if prerecord <> currentrec then
controlname.background = constantcolor1
else
controlname.background = constantcolor2
end if

In the loop of do until rsst.eof, so the problem is ACCESS won't allow me
have the prerecord to store its value, required me to have only one current
record..

Thanks
 
Hi,


Have you tried to use the RecordsetClone? moving it won't move the
"actually displayed" record.

Me.RecordsetClone.Bookmark = Me.Bookmark ' synchronize the clone to
what we see
If Me.RecordsetClone.BOF then ' if we are at the start

Me.ControlName.BackColor= ...

Else

With Me.RecordsetClone

.MovePrevious ' note the starting dot
If .Fields("fieldName") = Me.ControlName Then
Me.ControlName.BackColor=...
Else
Me.ControlName.BackColor = ...
End If

End With

End If



Hoping it may help
Vanderghast, Access MVP
 
No current record ... ???? ... wilthering .....ffuuuu..

Thanks

But as I copied the code and run up there is the message " NO CURRENT RECORD "

LET"S see the code point make mistakes:

With Me.RecordsetClone

.MovePrevious ' note the starting dot
If .Fields("REFNO") = Me.REFNO Then ' this code the
pointer stops at and highlights and MESSAGE UP NO CURRENT RECORD

Thanks
 
Hi,


You may have to test if you are in a new, not saved, record. Start the
whole thing with


If Me.NewRecord then
Exit Sub
End If



Vanderghast, Access MVP
 
Wo doo , Thanks

An alternative way is maybe to use array..

if there are some examples of arrays:


Thanks
 
Back
Top