vba-procedure

Find Error Line Number in VBA With Erl

In this post you are going to find out a way of handling errors in your code with the Erl function. Erl displays the last label before the error Another alternative error handling solution is using labels at each point in long procedure. Here we get a random error: Here is the code behind the […]

Continue Reading

Here Is A Customized Msgbox VBA Example

Here is an example of a customized VBA Msgbox. We giving some richtext and customizable flair to the rather ordinary message box. The following code provided with the code after the screenshot, is going to provide you with the ability to really make the ordinary message box shine! Sub MsgboxVBAExamples() Dialog.Box “VBAHowTo.com is your source […]

Continue Reading

How To Use The VBA Input Box Cancel Button To Exit Sub

This post will demonstrate how you can use the VBA input box cancel button to exit the sub procedure. When you click the “Cancel” button on the input box, you return a null (blank) value, and knowing this information, you can exit the sub procedure. Here is an example:   Sub VBAInputBoxCancel() Dim strResponse As […]

Continue Reading

VBA Debug Part 2

In this video I talk about VBA Debug aspects like the Immediate Window, Local Window and Watch Window. …also we use the “debug.print” statement to print a value to the Immediate window. The Local Window is useful to view the current state of all the variables present in the current sub procedure. The Watch Window […]

Continue Reading

MS ACCESS FORM OBJECTS – PT3

Get all the videos in this Access VBA collection 100% FREE by signing up at https://vbahowto.com/ms-access-tutorial In this video I talk about the “With” Statement, and 2 DoCmd methods, DoCmd.OpenForm and DoCmd.OpenReport There are many arguments for the OpenForm and OpenReport methods I will elaborate on at the blog, https://vbahowto.com This is part 3 of […]

Continue Reading

MS Access Form Events – PT1

In this video I talk about how to program vba object items like the ms access form. Specifically we look at the Access Form Open Event, and add a password prompt in the open event of the form, cancelling the open event if it is incorrect. Also we will look at controlling the Form_Load with […]

Continue Reading

How To Do A VBA CSV Import For One To Multiple Files

So you want to be able to import your csv for 1 to multiple files. Here’s how you do it. 1. up a form with a button. 2. After you click the button, you will get a File Dialog Box that will show you the csv files to choose from: Here is the code behind […]

Continue Reading

How To Send Email With Access And Outlook VBA

There are 3 things you probably want to send from your Access application. You probably want to send an Access report or send an attachment(s). 1. Email An Access Report (SendObject) 2. Email An Access Report With Attachments (Outlook Automation) 3. Email With Attachment(s) (Outlook Automation) First, if you are in the database, and want […]

Continue Reading

How To Use VBA To Extract Outlook Emails To Access Table

I use this code to extract outlook emails from a certain Outlook folder of a user (like the user’s Inbox) whenever they leave the department. This code will loop the Outlook Inbox (or other folder) of the logged in user’s Microsoft Exchange Account, and insert the body of the message into an Access table. Note: […]

Continue Reading

How To Run Access VBA On A Timer Schedule

At one of the contracts I am on currently, I run several backup procedures through out the day on some of the main tables if something should happen while I’m not on site. I set up a simple process. I am letting the Windows Task Scheduler, which runs as a service while the computer is […]

Continue Reading