Search Results For: loop

How To Exit A Do Or For Loop Using An API Call

This post is going to show you how you can exit a for or do loop in VBA using an API call. API calls use the power of the Windows operating system to do your wishes. Here we are using the “GetAsyncKeyState” API function: Insert the following code in a common module. Click in the […]

Continue Reading

How To Restart A VBA Loop Counter

This is related to an interesting question I received from an individual, and this processing example may help someone. Basically we are conducting a 10 day clinical study on a group of patients. We want to store the results of the finding in a database and reset the study counter when a result comes back […]

Continue Reading

How To Exit A VBA Loop

Hi, there are times when you need to exit a loop after a certain condition has been met. How do you exit function in VBA? In the following example, you are going to see how to exit a function in VBA: 1234567891011121314151617181920Sub StartNumbers()     Dim intNumber As Integer         intNumber = […]

Continue Reading

VBA For Loop

Use the VBA For Loop when you know how many iterations the code should make. Using this VBA For Loop will allow you to loop for a specific number of times. Take a look at the video: The syntax for the VBA For Loop is: ****************************************** For counter= start To end [Step backward count (how […]

Continue Reading

VBA Do Loop

Looping structures like the VBA Do Loop allow you to specify the conditions under which you would like your program to run a set of code statements repeatedly. There are 4 different variations of the VBA Do Loop we are going to look at: ‘Do While…Loop structures check the condition before running the code. ‘The […]

Continue Reading

How To Find Which Table Is Causing Your Access Database To Be So Big

Some of you, like me, sometimes have the question of “what is causing my Access database to be so big!” As you may or may not know, the database’s tables are the only objects which store the data. It’s very frustrating not to know, and just to try and look smart by saying the generic […]

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 get the images out of tblBinary

The custom ribbon uses the tblBinary to store images, but how do you get them out, if you want to use the nice images again for something else like a webpage toolbar? How to get the images out of tblBinary Well this code will loop the tblBinary table and save each image to the specified […]

Continue Reading

Peoplesoft To SAP Migration Via Access

I received an interesting question yesterday from a potential customer. They are migrating all their Oracle PeopleSoft data to SAP. (They are exporting from PeopleSoft into Excel, importing it into Access to tweak it, and exporting to csv from Access to upload to SAP) Basically, how to take 1 (PeopleSoft) row and make it into […]

Continue Reading

How To Generate A XML File With Access VBA

XML is used to structure your data. You can send a CSV file to another person, but using XML, you can structure your data in a more elegant format, and get very specific about your fields, and what data is contained within your tags (your field names). This is different than a basic CSV file […]

Continue Reading