Code to loop through all records in MS Access

You should be able to do this with a pretty standard DAO recordset loop. You can see some examples at the following links: http://msdn.microsoft.com/en-us/library/bb243789%28v=office.12%29.aspx http://www.granite.ab.ca/access/email/recordsetloop.htm My own standard loop looks something like this: Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset(“SELECT * FROM Contacts”) ‘Check to see if the recordset actually contains rows If Not … Read more

Difference between Microsoft.Jet.OleDb and Microsoft.Ace.OleDb

It’s mainly a matter of history, effectively ACE has superceded JET: Wikipedia answers your question in great detail. The most relevant sections are: With version 2007 onwards, Access includes an Office-specific version of Jet, initially called the Office Access Connectivity Engine (ACE), but which is now called the Access Database Engine. This engine is fully … Read more

How to open a folder in Windows Explorer from VBA?

You can use the following code to open a file location from vba. Dim Foldername As String Foldername = “\\server\Instructions\” Shell “C:\WINDOWS\explorer.exe “”” & Foldername & “”, vbNormalFocus You can use this code for both windows shares and local drives. VbNormalFocus can be swapper for VbMaximizedFocus if you want a maximized view.

VBA check if object is set

If obj Is Nothing Then ‘ need to initialize obj: ‘ Set obj = … Else ‘ obj already set / initialized. ‘ End If Or, if you prefer it the other way around: If Not obj Is Nothing Then ‘ obj already set / initialized. ‘ Else ‘ need to initialize obj: ‘ Set … Read more

How do you use version control with Access development?

We wrote our own script in VBScript, that uses the undocumented Application.SaveAsText() in Access to export all code, form, macro and report modules. Here it is, it should give you some pointers. (Beware: some of the messages are in german, but you can easily change that.) EDIT: To summarize various comments below: Our Project assumes … Read more