Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is .FindFirst Possible In Recordset.Clone?

Status
Not open for further replies.

SgtJarrow

Programmer
Apr 12, 2002
2,937
US
Access 97...

I am working on a variance checker for an invoice generation application. I have a table, tblCharges, with about 35 fields. What I need to be able to do is check approx 30 of these fields against themselves, one month difference...For example:

February field 1 compared against January field 1
February field 2 compared against January field 2
and so on

This will take place for about 350 records each month.

I decided to create a recordset of the table, and walk through it using a loop for each of the fields....fine, works great. Now I need to clone the recordset to find the previous month as such:

strDate = DateSerial(DatePart("yyyy", .Fields(0)), DatePart("m", .Fields(0)) - 1, 1)
strCriteria = "[Month] = " & strDate & " And [BaseNo] = " & .Fields(4) & """"
rsLast.FindFirst strCriteria

where field(0) houses the date and field(4) houses the base number.

Everytime I try to run this I get:
Error 3251 - Operation not supported for this type of object.

Whats wrong???? Any suggestions as to a better way to do this????
The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
I just checked the help file and confirmed that a recordsetclone is available only for the underlying recordset of a form. From what I gather from your post you are trying to get a cloned recordset of a recordset based on a table.

Why not two distinct recordsets. The first of your table as either a dynaset or a table. The second of the same table but opened as a snapshot so you can avoid potential IO conflicts.
 
I will try that...thanks. I know that will work, but in looking at the help fiels myself, I found a reference to recordset.clone being faster than two distinct recordset....

But thanks anyway. Will let you know how it turns out. The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top