Hi
I am trying to bookmark the position on a recordset to later return to the same position and the bookmark codes is returning no record.
I have not used this before but any help will be greatly appreciated. The problem is when stepping to RSBookmark = rs4.Bookmark
the rsbookmark has been set as variant
I am trying to bookmark the position on a recordset to later return to the same position and the bookmark codes is returning no record.
I have not used this before but any help will be greatly appreciated. The problem is when stepping to RSBookmark = rs4.Bookmark
the rsbookmark has been set as variant
Code:
Do While rs3.EOF = False
CrRecord = rs3!benefitsid & rs3!companyid & rs3!entityid & rs3!plandatailid & rs3!PlanCarrier & rs3!PlanType
If PrvRecord = CrRecord Then
If PrvMonth <> CrMonth Then
PrvMonth = Month(rs3!Invoicedate)
rs4.Bookmark = RSBookmark
TxtMonth = MonthName(Month(rs3!Invoicedate))
rs4.AddNew
SumInvoiceAmt = DSum("invoiceamount", "tbcolumnreporttemp", StrCriteria)
rs4.Fields(TxtMonth) = SumInvoiceAmt
rs4.Update
End If
Else
TxtMonth = MonthName(Month(rs3!Invoicedate))
rs4.AddNew
rs4!benefitsid = rs3!benefitsid
rs4!PlanCarrier = rs3!PlanCarrier
rs4!entityid = rs3!entityid
rs4!companyid = rs3!companyid
rs4!PlanType = rs3!PlanType
rs4!plandatailid = rs3!plandatailid
SumInvoiceAmt = DSum("invoiceamount", "tbcolumnreporttemp", StrCriteria)
rs4.Fields(TxtMonth) = SumInvoiceAmt
rs4.Update
PrvRecord = rs3!benefitsid & rs3!companyid & rs3!entityid & rs3!plandatailid & rs3!PlanCarrier & rs3!PlanType
PrvMonth = Month(rs3!Invoicedate)
db.TableDefs.Refresh
RSBookmark = rs4.Bookmark
End If
rs3.MoveNext
CrRecord = rs3!benefitsid & rs3!companyid & rs3!entityid & rs3!plandatailid & rs3!PlanCarrier & rs3!PlanType
CrMonth = Month(rs3!Invoicedate)
Debug.Print rs3!Invoicedate
Loop
Stop