| DatabaseLessons.com |
'Serving the Microsoft® Access |
|
|
Query Based RecordsetYou want to create a recordset while inside some VBA code. The method I use frequently is this:
(article continues after sponsor spot) That works fine for simple relationships, especially like the example, which only has a single table involved. What if you have a very complex query? I've had ones where I ran out of continuation lines! Why not just create a query using the query wizard and then use that as a basis for the recordset? Create the actual query and test it thoroughly. Add and test parameters if needed. Create some VBA code like the example below. NOTE: All the VBA code segments on the Database Lessons site assume that you have DAO references active. If you are not sure what this means, and you are using Microsoft Access 2000 or higher, click here.
Continue in your VBA code as you normally would with a recordset object. To have the parameters supplied by your form rather than being prompted for them one by one, see the article via this link. Happy Coding |
|
|
© 2006, 2007, 2008 Richard W. Killey. All Rights Reserved. - Privacy Policy |