vba-procedure
How To Create A Table In Access Using SQL And VBA
This post will show you how to create an empty table in access using sql and vba This is a simplified version of my other post, “Access VBA Create Table” That post was the more elaborate way of table creation with VBA. This one will just show how to generate an empty table. In the […]
How To Have Access VBA Link Tables Programmatically
This table relinking procedure is a really good example of how to use VBA to link your tables programmatically, and how to have MS Access refresh linked tables automatically. It allows re-linking all tables to a selected drive source (the folder the backend database is in). In this example, all of the tables that need […]
MS Access Running Count With String Column And Duplicates
In my previous post, https://vbahowto.com/ms-access-running-count-with-duplicates/, the DCount counter, works fine when you have a numeric value, and it works fine when you do the VBA counter when you do it on numeric column values, but what about counters on string columns with duplicates? MS Access Running Count With String Column And Duplicates Since an Access […]
How To Calculate Date Intervals With VBA DateAdd
One of my clients ask me to design a little utility to operate like the Outlook appointment recurrence feature. This the first basic step, so I wanted to share how I did it. I have a basic form where I’ll probably be adding more variables, but the functionality basically works like this: I have an […]
How To Make A VBA Message Box OK Cancel
Ever wonder how you can create a vba message box to gather “ok” and “cancel” answers? This is useful when you want a user to provide confirmation for a delete procedure or other long running process. When you want to gather feedback from the user do something like this: Sub VBAMessageBoxOkCancel() Dim intAnswer As Integer […]
How To Make A VBA Message Box Yes No
Continuing on with our VBA message box theme, here is how to create a “VBA message box yes no” The message box can be used like a function to return a value. Here I am going to return a value to determine if the user clicked “yes” or “no”. For this I am going […]
Client Side Storage Access And WebSQL Database Part2
In this revised procedure I will create the SQLlite (WebSQL) database to hold the Access query contents and then display them on a web form in a table format. (don’t be concerned with the colors in the following code:) Sub GenerateContainmentInspectionsHTML() ‘HERE YOU ARE MAKING THE DATABASE FOR THE INSPECTIONS Dim intRandomDB As Integer Dim […]
VBA Move File
So you need to end off a procedure by moving a file? This video shows you how to use the FileSystemObject and vba to move a file out of one directory into another? Well, this video shows you how to do it… Option Compare Database ‘======================================================== ‘DATABASE DESIGNED & CODED BY LOEBLCOM SERVICES 2013 ‘ERIK […]
VBA Error Handling PT1
In this VBA Error Handling set (1 & 2) we’ll talk about: Trapping run-time errors Creating error handlers Using the error object There are 3 main types of VBA Errors: 1. Syntax Errors 2. Logic Errors 3. Run-Time Errors Syntax errors result when the logic is misspelled, or a wrong keyword is used. The VBA […]
VBA Form Object Event Procedures
In this video I talk about how to program vba object items like the access form . Specifically we look at the Access Form Open Event, and add a password prompt in the open event of the form. Also we will look at controlling the Cancel Open Event of the form. Private Sub Form_Open(Cancel As […]