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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

type mismatch creating a loop in access xp 1

Status
Not open for further replies.

xyle

Programmer
Jul 2, 2003
23
US
I've used the same basic loop many of times in Office 97 and databases I import from office 97 with the same loop in it will still work. But if I go to create and run this code in XP I get a type mismatch error.

Dim Rec as Recordset

Set Rec = Me.RecordsetClone '<<Here is where i get the error

Rec.MoveFirst
Do Until Rec.Eof
Me.bookmark = Rec.Bookmark

'(whatever code I need to execute here)

Rec.MoveNext
Loop

End Sub

I don't know if there is a different way to code a similar loop or what. I've checked the options and properties but I don't see anything different between the form I created In XP and the form I imported from 97. The funny thing is, if I import the form I created in XP into the database I imported from Office 97 it will work in XP but not vice versa.
 
Hi!

In the code window go to Tools-References and make sure the reference to DAO 3.6 is checked. Then you will need to move the reference as far up as it can go or add DAO to your declaration:

Dim Rec As DAO.Recordset

I like the explicit declaration so there can be no confusion.

hth


Jeff Bridgham
bridgham@purdue.edu
 
thanx jebry that worked

silvis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top