Re: recordset.MovePrevious

From: TC (no_at_email.here)
Date: 04/22/04


Date: Thu, 22 Apr 2004 12:33:38 +0930

You need to cut & paste the exact code you are using - from & including the
declaration of rstQryRecordset, thru & including the final if-test. The code
that you have shown is incomplete, & clearly not a cut & paste (since it
contains at least one syntax error that would stop it running >at all<).

Also, you need to quote the exact text of the error(s) you get, & show what
line(s) they occur on. It is waaay not enough to say, "I get an error that
basically says I cannot do it".

"Value" is not a good name for a field. It is a so-called "resevred word" in
Access. Check out "reserved words" in online help.

HTH,
TC

"newguy" <anonymous@discussions.microsoft.com> wrote in message
news:249501c427cc$8676f0d0$a401280a@phx.gbl...
> 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.



Relevant Pages

  • recordset.MovePrevious
    ... to compare 2 items in a query based recordset. ... "Query Based Recordset" ... to look at the value, store it as a variable, then look at ...
    (microsoft.public.access.modulesdaovba)
  • Re: recordset.MovePrevious
    ... Without seeing how you've opened the recordset, ... Microsoft Access 2003 VBA Programmer's Reference ... > to compare 2 items in a query based recordset. ... > to look at the value, store it as a variable, then look at ...
    (microsoft.public.access.modulesdaovba)
  • Re: Comparing Two Identical Tables - Loop Through fields in a Recordset
    ... two tables and writing to a recordset of the third table? ... Field7 = GG ... dim db as database, rs as recordset, cSQL as string ... 'COMPARE NUMERIC DATA - ABSOLUTE % CHANGE ...
    (comp.databases.ms-access)
  • Re: recordset handling question
    ... I left out the compare code because I did not ... I did include the part I need help with (writing the recordset to ... as to row/recordset, i was not sure what other would know it as, so I ... Please clarify how you are comparing. ...
    (comp.databases.ms-access)
  • Re: Update an SQL database
    ... Try using Echo for every row in the recordset, ... If objRecordSet.Fields= strServerName Then ... want to compare my variable with the record in the database, ...
    (microsoft.public.data.ado)