In a recent project, I was tasked with designing a program in Access where an end user could import a spreadsheet, run a sub routine in VBA and export the results. As part of the user experience, I wanted the end user to be able to select the input spreadsheet with the file dialog tool. UPDATE 05/22/2015: The function below contains an error handler and works well if your … [Read more...] about Select or Open a file in VBA with file dialog | Access VBA
Archives for August 2013
How to Count Records in VBA | Microsoft Access 2010
In a recent program that I wrote, I needed to store a count of records from a query in a variable. Since VBA and Access isn't as intuitive as say connecting to a MySQL database with PHP, I thought I would share. Function recordCount() Dim rs As DAO.Recordset Dim db As Database Dim strSQL As String Set db = CurrentDb 'Count Query - replace query with your … [Read more...] about How to Count Records in VBA | Microsoft Access 2010