Re: recordset.MovePrevious
From: TC (no_at_email.here)
Date: 04/22/04
- Next message: Graham R Seach: "Re: recordset.MovePrevious"
- Previous message: Graham R Seach: "Re: Is there a more elegant way of doing this ??"
- In reply to: newguy: "recordset.MovePrevious"
- Next in thread: Graham R Seach: "Re: recordset.MovePrevious"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: Graham R Seach: "Re: recordset.MovePrevious"
- Previous message: Graham R Seach: "Re: Is there a more elegant way of doing this ??"
- In reply to: newguy: "recordset.MovePrevious"
- Next in thread: Graham R Seach: "Re: recordset.MovePrevious"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|