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

For each ...

Status
Not open for further replies.

ak48

Technical User
Aug 1, 2003
34
US
Hi, I got this simple code exemple from an access 97 book

Private sub ListDBProperties()
Dim pty as property

For Each pty in CurrentDb.Properties
Debug.print pty.Name & ": " & pty.Value
Next

End Sub

My problem is that the function won't work in access 2000 (I get a type mismatch error on the For Each line). The only wayt to make it work is to declare pty as Object instead of property. Is it a access 2000 bug or is there a reason for this?
 
Hi!

Access 2k assumed that the property object was an ADO object which doesn't recognize the CurrentDb function. You will want to be sure that the reference to the DAO library is selected and declare your variable specifying DAO:

Dim pty As DAO.Property.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top