Re: recordset.MovePrevious
From: Graham R Seach (gseach_at_NOSPAMpacificdb.com.au)
Date: 04/22/04
- Next message: TC: "Re: Security FAQ code problems"
- Previous message: TC: "Re: recordset.MovePrevious"
- In reply to: newguy: "recordset.MovePrevious"
- Next in thread: TC: "Re: recordset.MovePrevious"
- Reply: TC: "Re: recordset.MovePrevious"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Apr 2004 12:59:56 +1000
Without seeing how you've opened the recordset, it's possible that you've
opened it as Forward-only, in which case, you won't be able to go backwards.
...otherwise, check to make sure you're not at the beginning of the dataset:
If Not rstQueryRecordset.BOF Then rstQryRecordset.MovePrevious
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
"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: TC: "Re: Security FAQ code problems"
- Previous message: TC: "Re: recordset.MovePrevious"
- In reply to: newguy: "recordset.MovePrevious"
- Next in thread: TC: "Re: recordset.MovePrevious"
- Reply: TC: "Re: recordset.MovePrevious"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|