admin

Error In Loading DLL And DAO DLL Download

The other day I was doing a database modification for a long time customer, and I was compiling their database, when the compilation failed at a line of VBA code calling for a DAO object. FYI: I originally designed this bit of code for a prior Access version and now they had upgraded to an […]

Continue Reading

What Is The Access VBA NZ Function

The Access VBA NZ function allows you to test for values with zero length. It is unique with Access, as far as I know, no other language has this type of function, and you’ll have to make your own. If you want to check if a variable is blank, you should check the length (contents) […]

Continue Reading

How To Use Access VBA To Copy A Table With DoCmd.CopyObject

This post was actually inspired by a question I received from this site’s chatbot. In this post you will find how you can use Access VBA and the DoCmd.CopyObject method to copy a blank table, and append the value of a combobox to it. The database has just one blank table “tblFacilityBlank”, that we’ll copy […]

Continue Reading

An Easy VBA Counter

This post is actually based on a question I received on my YouTube video: https://www.youtube.com/watch?v=l5Aj8dPH8KY&lc=z234unjqmpymudvjp04t1aokgbwgqi4nrfxkozk3u00rrk0h00410 The counter can be implemented a bit easier by using VBA. Here’s how: Sub AddCounter() Dim intCounter As Integer Dim strSQL As String Dim strSQLUpdate As String Dim rst As Recordset ‘counter is done based on the sort order ‘strSQL […]

Continue Reading

Access VBA Create Table (Simplified)

This post is an answer to someone else who wanted to create a table and field names based on form inputs. So I simplified a past post: http://vbahowto.com/how-to-create-a-table-in-access-using-sql-and-vba/ Here are the form inputs: …and when you click the button, the following code runs: Private Sub btnCreateTable_Click() CreateNewTable MsgBox “Table Created. (Press F5 on your keyboard […]

Continue Reading

MS Access FilterOn Error (Solution)

This may help give you a clue to why your Me.FilterOn is not working properly. My form was doing some filters, but when it came to filtering the date, it wasn’t operating correctly. Here is my filtering code: If Len(FilterString) > 0 Then Me.Filter = FilterString Me.filterOn = True End If I noticed that if […]

Continue Reading

How To Find Certain Files In VBA

Someone wanted to loop through the files in over 100 directories and find a list of their powerpoint files. This code will loop a specific directory and check if a file with a “pptx” extension exists in that directory. If it does, a message box will be displayed. Instead of the message box, the file’s […]

Continue Reading

How To Identify The Last Row Worked On (VBA Variable Scope)

So, I had an interesting question regarding how to find the last row the user was working on before the closed the form, so when the reopen the form, they could continue to work on that record. (This is actually expanding on an example I showed: http://vbahowto.com/how-to-highlight-the-current-row-in-a-continuous-form-in-3-steps/) The the following code will demonstrate one way […]

Continue Reading

How To Attach Files In An Access Database

If you noticed Access now has a datatype to add attachments. If you don’t want to program this with VBA as I show you how to do below, you can use it (if you dare :)). I think Microsoft wanted to make things easier for the user, so they added the ability to add attachments […]

Continue Reading

MS Access VBA Programming – Responding To User Actions

In this video I’m going through module 2 of the “Donors and Donations” database course, http://vbahowto.com/ms_access_prog/donors_and_donations You are going to find out solutions and ideas in this video such as: -What are control events, and how can you benefit? -How to reference form objects. -How to set control properties -How to obtain values entered into […]

Continue Reading