ProgrammingMSAccess.com

Learn about Developers Group
Join Developers Group
Order SPAM Blocker
Free Stuff
Guest Book
.NET Resources
SQL Server Resources
Favorites
Technical Support
Books & DVDs by Webmaster
Articles, tutorials, & more
FAQs
Product Reviews
Samples
Prior Newsletters
Contact Us
Home
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A vba Procedure that opens A view IN PUBS FROM AN access project

 

 

'Connect the Access project to a copy of the Pubs database

'Make sure the VBE window has a reference to the ADODB library

 

Sub Opentitleview()
Dim rst1 As ADODB.Recordset

'Set recordset source to view name and Options
'parameter to adCmdTable
Set rst1 = New ADODB.Recordset
rst1.Open "titleview", CurrentProject.Connection, _
, , adCmdTable

'Loop through recordset until EOF
Do While Not rst1.EOF
    Debug.Print rst1("title") & " by " & rst1("au_lname") & _
        " sells for " & rst1("price") & "."
    rst1.MoveNext
Loop

End Sub

 

Want to understand  Microsoft Access 2000 so that you can program it to do more tasks like this?  Get Programming Microsoft Access 2000 by Rick Dobson from Microsoft Press.  Learn more about the book by clicking here.

Copyright 1999 CAB, Inc. All rights reserved. Republication or redistribution of CAB, Inc. content, including by framing or similar means, is expressly prohibited without the prior written consent of CAB, Inc. CAB, Inc. shall not be liable for any errors in the content, or for any actions taken in reliance thereon.