N
newguy
I am currently working on a project that will require me
to compare 2 items in a query based recordset. The items
are in the same field, just 1 record apart. Basically, I
need to compare the 2 values to determine whether or not I
should do one thing or another. For example:
"Query Based Recordset"
VALUE
A
A
B
Value is the name of the column in the recordset. I need
to look at the value, store it as a variable, then look at
the next value, store that, compare the 2, and do
something. This is what I tried to do:
Dim stFirstVal, stSecondVal As String
stFirstVal = rstQryRecordset("Value")
rstQryRecordset.MoveNext
stSecondVal = rstQryRecordset("Value)
rstQryRecordset.MovePrevious
If stFirstVal = stSecondVal THen
"do this and that"
Else
"do that and this"
End If
Everything works fine, except I cannot get the
MovePrevious to work, I get an error that basically says I
cannot do it, and I have no idea why. Please help.
to compare 2 items in a query based recordset. The items
are in the same field, just 1 record apart. Basically, I
need to compare the 2 values to determine whether or not I
should do one thing or another. For example:
"Query Based Recordset"
VALUE
A
A
B
Value is the name of the column in the recordset. I need
to look at the value, store it as a variable, then look at
the next value, store that, compare the 2, and do
something. This is what I tried to do:
Dim stFirstVal, stSecondVal As String
stFirstVal = rstQryRecordset("Value")
rstQryRecordset.MoveNext
stSecondVal = rstQryRecordset("Value)
rstQryRecordset.MovePrevious
If stFirstVal = stSecondVal THen
"do this and that"
Else
"do that and this"
End If
Everything works fine, except I cannot get the
MovePrevious to work, I get an error that basically says I
cannot do it, and I have no idea why. Please help.